Bash . Running Several Commands All at Once

commandline session $ls src war $cd & ls & [1] 2587 [2] 2588 $src war [1]- Done cd [2]+ Done ls –color=auto $pwd /home/jeffrin/beautiful-work $ $cd & ls & cd & [1] 2590 [2] 2591 [3] 2592 $src war [1] Done cd [2]- Done ls –color=auto [3]+ Done cd $pwd /home/jeffrin/beautiful-work $cd .. & pwd …

Basic tinkering with “set” command and “noclobber” related

commandline session [bash light=”true”] $echo improve > clean.txt $cat clean.txt improve $set -o noclobber $echo new > clean.txt bash: clean.txt: cannot overwrite existing file $echo new >> clean.txt $cat clean.txt improve new $echo again >| clean.txt $cat clean.txt again $set +o noclobber $echo improve > clean.txt $cat clean.txt improve $ [/bash]

Errors and Exceptions

commandline session $gcc error.c $cat error.c #include main() { int a=0; int b=10; printf(“Hello Alln”); printf(“%d”,b/a); } $./a.out > outputa Floating point exception $cat outputa $ $./a.out 2> outputa Hello All Floating point exception $./a.out > outputa Floating point exception $./a.out 2> outputb Hello All Floating point exception $./a.out &> outputc Floating point exception $cat …

pattern matching operators PART 1

commandline session $cat pm.sh #!/bin/bash filename=${1##*/} echo $filename $sh pm.sh /bin/bash bash $vim pm.sh $cat pm.sh #!/bin/bash filename=${1} echo $filename $sh pm.sh /bin/bash /bin/bash $vim pm.sh $cat pm.sh #!/bin/bash filename=${#} echo $filename $sh pm.sh /bin/bash 1 $vim pm.sh $cat pm.sh #!/bin/bash filename=${##} echo $filename $sh pm.sh /bin/bash 1 $vim pm.sh $cat pm.sh #!/bin/bash filename=${*} echo …