- which $SHELL
- #!/bin/bash
- echo "hello world"
- echo -n “Prints and goes to a new line for input“
- sleep
- ls -l
-
eg. add an executable permission modification : chmod +w
- ./milind.sh
-
if condition :
if [ $((x % 2)) == 0 ]; then \n echo “Number is Even” \n fi
-
fi : means finish if
-
if [ condition1 ]; then \n # Code to be executed if condition1 is true \n elif [ condition2 ]; then \n # Code to be executed if condition2 is true \n elif [ condition3 ]; then \n # Code to be executed if condition3 is true \n else \n # Code to be executed if none of the conditions are true \n fi
for n in a b c;
do
echo $n
done- for n in {1..5}; do echo $n done
string1="GeekForGeeks"
string2='Geeks for Geeks'
string3=2345656778
#Printing the strings
echo $string1
echo $string2
echo $string3string="geeksforgeeks"
echo "The length of the string is : ${#string}"