Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ##### showing includes
- [root@localhost bash-scripting]# cat mainscript
- #!/bin/bash
- . includes
- echo the color is $COLOR
- [root@localhost bash-scripting]# cat includes
- COLOR=red
- ##### SCRIPT 10 FIX
- #!/bin/bash
- COUNTER=$1
- COUNTER=$(( COUNTER * 60 ))
- minusone(){
- COUNTER=$(( COUNTER - 1 ))
- sleep 1
- }
- while [ $COUNTER -gt 0 ]
- do
- echo you still have $COUNTER seconds left
- minusone
- done
- [ $COUNTER = 0 ] && echo time is up && minusone
- [ $COUNTER = "-1" ] && echo you now are one second late && minusone
- while true
- do
- echo you now are ${COUNTER#-} seconds late
- minusone
- done
- #### HISTORY
- root@localhost bash-scripting]# history
- 1 yum install -y git vim bash-completion
- 2 git clone https://github.com/sandervanvugt/bash-scripting
- 3 history
- 4 ls
- 5 cd bash-scripting/
- 6 ls
- 7 vim script1
- 8 vim ~/.vimrc
- 9 vim script1
- 10 vim ~/.vimrc
- 11 vim script1
- 12 ls /etc/hosts
- 13 echo $?
- 14 ls kejrhgkehrkhb
- 15 echo $?
- 16 vim script1
- 17 script1
- 18 echo $PATH
- 19 ./script1
- 20 ls -l
- 21 chmod +x s*
- 22 ls -l
- 23 ./script1
- 24 echo $?
- 25 pwd
- 26 echo $PATH
- 27 PATH=$PATH:$(pwd)
- 28 script1
- 29 echo $PATH
- 30 history
- 31 vim script2
- 32 script2
- 33 pwd
- 34 cat script2
- 35 source script2
- 36 cd bash-scripting/
- 37 vim script2
- 38 source script2
- 39 pwd
- 40 cd -
- 41 . script2
- 42 cd -
- 43 yum install -y network-scripts
- 44 ls
- 45 vim mainscript
- 46 vim includes
- 47 chmod +x mainscript
- 48 ./mainscript
- 49 vim includes
- 50 ./mainscript
- 51 cat mainscript
- 52 cat includes
- 53 cd /etc/init.d/
- 54 ls
- 55 history | head
- 56 vim network
- 57 cd /etc/sysconfig/
- 58 ls
- 59 ls -l
- 60 vim rsyslog
- 61 cd
- 62 cd bash-scripting/
- 63 history
- 64 file /usr/bin/passwd
- 65 file /etc/hosts
- 66 script1
- 67 file script1
- 68 grep COUNT *
- 69 ./countdown 12
- 70 vim script3
- 71 ./script3 a b c d e f g h i j k l
- 72 cat script3
- 73 /root/bash-scripting/script3 a b c d e f g h i j k l
- 74 true --help
- 75 false --help
- 76 vim script4
- 77 ./script4 a b c d e
- 78 cat script4
- 79 vim ex5min.txt
- 80 ./countdown 4
- 81 vim ex5.sh
- 82 bash ex5.sh bob bill joan
- 83 cat ex5.sh
- 84 ls
- 85 vim script5
- 86 vim script6
- 87 ./script6 /usr/bin/blah
- 88 vim script6
- 89 ./script6 /usr/bin/blah
- 90 ./countdown 12
- 91 ls
- 92 vim script7
- 93 which sed
- 94 ls -l /bin/sed
- 95 ls -l /bin/awk
- 96 ls -l /bin/gawk
- 97 help
- 98 vim script7
- 99 vim script6
- 100 history | grep PATH
- 101 vim script5
- 102 cd /lib/modules
- 103 ls
- 104 ls -l
- 105 uname -r
- 106 cd `uname -r`
- 107 cd ..
- 108 cd $(uname -r)
- 109 cd
- 110 cd bash-scripting/
- 111 vim script5
- 112 vim script8
- 113 cut -d : -f 1 /etc/passwd
- 114 vim script8
- 115 useradd alexander
- 116 useradd alex
- 117 useradd xander
- 118 ./script8 alex
- 119 ./script8 lex
- 120 cat script8
- 121 cut -d : -f 1 /etc/passwd | grep alex >/dev/null && echo alex exists
- 122 cut -d : -f 1 /etc/passwd | grep bea >/dev/null && echo alex exists
- 123* cut -d : -f 1 /etc/passwd | grep bea >/dev/null || echo
- 124 cut -d : -f 1 /etc/passwd | grep alex >/dev/null && echo alex exists || echo alex does not exist
- 125 vim ex6.sh
- 126 chmod +x ex6.sh
- 127 ./ex6.sh lex
- 128 ./ex6.sh alex
- 129 cat ex6.sh
- 130 man test
- 131 vim script9
- 132 ./script9
- 133 echo $?
- 134 ./script9 hello
- 135 vim script10
- 136 vim countdown
- 137 ./countdown 1
- 138 vim hv.sh
- 139 chmod +x hv.sh
- 140 ./hv.sh 1
- 141 bash -x hv.sh 1
- 142 vim hv.sh
- 143 ./hv.sh
- 144 ./hv.sh 1
- 145 vim hv.sh
- 146 ./hv.sh 5
- 147 ./countdown 1
- 148 echo $(( 4 + 4 ))
- 149 echo $( 4 + 4 )
- 150 ls $(which passwd)
- 151 [ -f /etc/passwd ] && echo it exists
- 152 [-f /etc/passwd] && echo it exists
- 153 ls /etc/hosts
- 154 ls/etc/hosts
- 155 ./countdown 12
- 156 vim script10
- 157 ./script10 1
- 158 wc script10
- 159 bash -x script10
- 160 vim script10
- 161 ./script10 1
- 162 vim script10
- 163 ./script10 1
- 164 bash -x ./script10 1
- 165 vim script10
- 166 ./script10 1
- 167 vim script10
- 168 ./script10 5
- 169 vim script10
- 170 ls
- 171 vim kube-setup.sh
- 172 cd ..
- 173 git clone https://github.com/sandervanvugt/ckad
- 174 cd ckad
- 175 vim kube-setup.sh
- 176 hostnamectl
- 177 vim kube-setup.sh
- 178 ./kube-setup.sh
- 179 cd ../bash-scripting/
- 180 ls
- 181 cat rene
- 182 vim rene
- 183 ./rene
- 184 cd /etc/init.d/
- 185 vim network
- 186 cd
- 187 cd bash-scripting/
- 188 ./countdown 5
- 189 history
Add Comment
Please, Sign In to add comment