Bash scripts are simple text files that contain a collection of commands. Bash scripts can help with administrative tasks, task…
Browsing: bash
Similar to for loop, while loop is also entry restricted loop. It means condition is checked before executing while loop.…
Loops are very useful for doing repetitive tasks for any programming language. For loops are also available for bash scripting.…
Sample Script STR=”Sarah;Lisa;Jack;Rahul;Johnson” IFS=’;’ read -ra NAMES
Command SNAME=$(basename “$(test -L “$0” && readlink “$0” || echo “$0″)”) While running a bash script using Linux terminal the…
Command: str3=”$str1 $str2″ The above example command will concatenate values of str1 and str2 stings and store it in third…
Command: if [ “$str1” == “$str2” ] Example: Take input of two string in a script and compare if both…
Command: while true;do echo “Press CTRL+C to Exit”; done Example 1: Some times we are required to execute some commands…
Command: echo -e “\\e[0;41mBackground in Red Color\\e[0m” The Above commands are using to set background color of output on Linux…
# echo -e “e[0;31mText in Red Colore[0m” The Above commands are showing to set foreground ( Text ) color of…