The first line of the script should read
#!/bin/bash
And then you can check the number of command line arguments that are passed into the script with
$#and then the arguments can be accessed by using
$1 or $2, etc.and the name of the script can be accessed with
$0and finally, all the command line arguments can be accessed with
$@
No comments:
Post a Comment