Variables in Bash shell scripting

What is variable ?

          Every variable contains meta data either is system defined or user defined.
      In every programming language variable play's important role,in Linux there are two types of variables System defined variable and User defined variable.


System defined variable:

         It defined by system,means every OS have some default variables called  system variables.
Example:
$PATH
$date

output
Sun May 12 11:56:34 IST 2019


User defined variable:

        It defined by user,means user need to create,define variable.
Example:
cpu=$( top -b -n1 | grep "Cpu(s)" | awk '{print $2 }'  | cut -d'.' -f1 )
here,we are taking CPU usage 





Comments

Popular posts from this blog

Awk command with simple examples

Learn Linux in Telugu | Linux complete Free Course in Telugu by 7Hills

rsync Command Examples | rsync Command In Telugu