Quots in Linux - Tecnew

Home Ads

demo-image
.com/img/b/R29vZ2xl/AVvXsEiTZ85VMSJHP0QTpXxgXlo61MheDxguF_SS_cKjVU9rFE1nmskz9Kf0tosuSQwsEFEUQSQrO3EAY8-bAC-W5uoWZk7Wc7FMmr-8KaUb8An1xPbZUv9EYM9LL1etiEUZkDt8v2M-dr8sviA/

Quots in Linux

Share This



 Single and double Quots in Linux 

In Double Quots ""   $ value is takes the value of the variable 
1.     speaker=”marshal” assigned to speaker
echo $speaker it shows the output marshal
echo “I have got $speaker speaker recently.”  $ is reads the variable value
I have got marshal speaker recently.

.com/img/b/R29vZ2xl/AVvXsEjykA_rXb8hBnnD1LpNFjK6W6hAXszXQdr9vS-BjQMgxhUF6o6pvpOn8m0YVcdM9Kv9oXb8wU5PTfmsLDjWQycET131gKLg2DWUv3JPZWbAPQ3Q2lIPsxcz9VetoZ49malBXf7onCbVn1M/

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 

.com/img/b/R29vZ2xl/AVvXsEii6Qe8z9O4XOuuiEiADwTsgieFverD8AZ7N4hFHNkZGfE2Zl237C4N00dhKEVa119SPJ2Y-5JYOV2xGTo5PZVcRIkEUIzwWKvJVTWwPyzJV7jS1mILh54rws0LwykADEQ9OSSrmjpr51E/

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" 

.com/img/b/R29vZ2xl/AVvXsEjkTMdpl0LWXszfP21k-2S4vT9LQTBBLDR2H6mSAIa06CHXMEL2RTv9JuBQx5rDWmocqqVw2XVFuY32O6XqPQAHq0KYXA5J6sfE_NYuApyFsphWMgrHsoN3K7Yoc6lJ8wVyKuKNwJDvCWg/



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
        1.Out=`uptime`
           Echo $out    it gives the uptime command output
        2.Out=$(uptime)
           Echo $out    it gives the uptime command output
          free -m | grep Mem | awk '{print $4}' This command gives the out put of 4th column
        FREE_RAM=` free -m | grep Mem | awk '{print $4}'`  it stores the output of the the                    command in to that variable FREE_RAM to prin the output type echo $FREE_RAM to               give the output

.com/img/b/R29vZ2xl/AVvXsEjLb_8AF_sk30a3W7tpGH43devr0_O5LB8_PGhI5ZAZ-e0DX9AA6ASVlPFphooIIvBYkDtgcviKI4jiOLMsfKTyQ3qReFACuVzgyZzFAmdO84_KPeBbtcJz2n_XNVQIUT9SgQrnfw7FNL8/

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

.com/img/b/R29vZ2xl/AVvXsEh4WzrybWcZ-qkOFA4WpWKqdqPTSMr6c40emU3sA4ixB0yQ_xcYmgofEMLnSD_BGU4kf7ZaCbw87oj-EBRW5IkmSiLRLmJPHiJwSAm8ZoGrHPI_Jm-FNrH-JBU6tKcYozuBo6m4Bj6J_5c/


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,

.com/img/b/R29vZ2xl/AVvXsEgt1fNp0IDYVo7U1QJiV2WfSl1zbU8IeOWvrfgM1G22430U2sTDqbE1Yq_dFLEEUPNp-SZF1V93QFNg40YUe-qyzO6ut0qbByjkNSJuMXzrdJJS90Eta-gJQ4grfLQncXwSE2T89_i_iXc/



No comments:

Post a Comment

Pages