Debugging under shell script.
1) -x option to debug a shell script Run a shell script using -x option $bash -x script-name $bash -x temp.sh farhat…
Read more1) -x option to debug a shell script Run a shell script using -x option $bash -x script-name $bash -x temp.sh farhat…
Read moreBuiltin variables $0 = The filename of the current script. $# = The number of arguments supplied to a script. $*…
Read morep12.sh #!/bin/bash fun () { echo $1 //will print orange echo $2 $1 …
Read morep11.sh #!/bin/bash fun () { echo "I am working with Bash Shell scripting," } fun echo "Its a good w…
Read morep10.sh #!/bin/bash line1=`head -4 /etc/passwd` line2=`tail -3 /etc/passwd` echo -e "First 4 lines are :\n &quo…
Read morep9.sh #!/bin/bash echo "Enter number a: " read a echo "Enter number b: " read b echo "En…
Read morep8.sh #!/bin/bash echo "Enter Username: " read name if grep "$name" /etc/passwd then echo …
Read morep7.sh #!/bin/bash echo "Enter a: " read a echo "Enter b: " read b if test $a == $b ; then …
Read morep6.sh #!/bin/bash i=0 for users in `cat /etc/passwd | awk -F: '{print $1}'` do echo "$((i++)): $user…
Read morep5.sh #!/bin/bash echo "Your username is $USER "
Read morep4.sh #!/bin/bash echo " Usernames are: " cat /etc/passwd | awk -F: '{print $1}' :./p4.sh
Read morep3.sh #!/bin/bash sort=`sort /etc/passwd` echo "shorted list are:" echo "$sort" :./p3…
Read morep2.sh #!/bin/bash result=`cat /etc/passwd | wc -l` echo "Total number of users $result" :./p2.sh
Read morep1.sh #!/bin/bash Result=`cat /etc/passwd` echo "$Result" :wq! //save and exit vi …
Read more