11.03.2020
Posted by 
Linux command line input

New User Command Line Won't Input Tools

New

List Users Command Line

Command prompt user input

Let’s create a shell script with name “commandlineagruments.sh”, it will show the command line argruments that were supplied and count number of agruments, value of first argument and Process ID (PID) of the Script.:$ cat commandlineagruments.sh Assign Executable permissions to the Script:$ chmod +x commandlineagruments.sh Now execute the scripts with command line arguments:$./commandlineagruments.sh Linux AIX HPUX VMware There are 4 arguments specified at the command line. The arguments supplied are: Linux AIX HPUX VMware The first argument is: Linux The PID of the script is: 16316 Shifting Command Line Arguments The shift command is used to move command line arguments one position to the left. During this move, the first argument is lost. “commandlineagruments.sh” script below uses the shift command::$ cat commandlineagruments.sh Now Execute the Script again.:$./commandlineagruments.sh Linux AIX HPUX VMware There are 4 arguments specified at the command line The arguments supplied are: Linux AIX HPUX VMware The first argument is: Linux The Process ID of the script is: 16369 The new first argument after the first shift is: AIX The new first argument after the second shift is: HPUX:$ Multiple shifts in a single attempt may be performed by furnishing the desired number of shifts to the shift command as an argument.