arguments of shell


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



Copy this code and paste it in your HTML
  1. #!/bin/bash
  2. echo \$0=$0 # argv[0]
  3. echo \$1=$1 # argv[1]
  4. echo \$#=$# # argc
  5. # if argv[0] does not exist, print message after '?'
  6. echo ${1?"Usage: $0 ARGUMENT"}

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.