Single and double Quots in Linux
In Double Quots "" $ value is takes the value of the variable
1. speaker=”marshal”
assigned to speaker
echo “I have got
$speaker speaker recently.” $ is
reads the variable value
I have got marshal
speaker recently.
1. speaker=’marshal’
assigned to speake
echo ‘I have got
$speaker speaker recently.’ $ is
reads the variable value
I have got $speaker
speaker recently. In single quot $ is read as a text
In some places you use $ as it is in double quots in such a case you use \$5 echo "world spending $5 billion for $virus"
1. Output of the command is stored in to the variable
Back
tick is the command is down to the esc button `` you kept in between the
backtick out=`uptime`
This
is two types we use
Echo $out it gives the uptime command output
2.Out=$(uptime)
free -m | grep Mem | awk '{print $4}' This
command gives the out put of 4th column
1.
Two know available df -h disc space of free size only by using the command by df -h | awk
‘{print $4}’ it shows the fourth column of free disc space
To show uptime in that we print only time by the following command UPTIME=$(uptime | awk '{print $1,$2,$3}') echo $UPTIME 12:46:58 up 7:05,
No comments:
Post a Comment