Test first command line argument

/ Published in: Bash
Save to your folder(s)

Copy this code and paste it in your HTML
  1. if [ -z "$1" ]; then
  2. # No command-line arguments.
  3. else
  4. # First command-line argument is $1.
  5. fi

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.