How do you read a command line argument in Unix?

How do you read a command line argument in Unix?
Answer
Read Command-line Arguments in Shell Scripts
  1. #!/bin/sh. echo “Script Name: $0” echo “First Parameter of the script is $1” echo “The second Parameter is $2” echo “The complete list of arguments is
    [email protected]
    ” echo “Total Number of Parameters: $#” echo “The process ID is $$” echo “Exit code for the script: $?”
  2. . / PositionalParameters .sh learning command line arguments.
 

Tìm kiếm

Back
Top