SHIFT command in Unix

PREV     NEXT

  • The shift command in UNIX is used to move the command line arguments to one position left. The first argument is lost when you use the shift command.
  • Shifting command line arguments is useful when you perform a similar action to all arguments one-by-one, without changing the variable name. The shift command throws away the left-most variable (argument number 1) and reassigns values to the remaining variables.
  • The value in $2 moves to $1, the value in $3 moves to $2, and so on.

Ex:

Execution Results:


OTHER ADVANCED UNIX COMMANDS:

Below are the list of advanced UNIX commands used in UNIX operation system.

1 .GREP Command in Unix 
2.Whoami Command in Unix
3.Passwd Command in Unix
4.Kill Command in Unix
5.Ps -Ef Command in Unix
6.Df -k Command in Unix
7.Bdf Command in Unix
8.ftp Command in Unix
9.Find Command in Unix
10.Date Command in Unix
11.Uptime Command in Unix
12.Clear Command in Unix
13.Shift Command in Unix
14.Sort Command in Unix
15.Crontab Command in Unix
16.Unix Command Line Arguments

PREV     NEXT

Share this website !!!
Facebook Twitter Linkedin