Concepts:
How to pass arguments from a shell to a bash script
Text:
Implement a bash script that:
3
, the script must print an error message before stopping the execution
Solution:
#!/bin/bash echo "Number of arguments: $#" if [ $# -ne 3 ] then echo "Usage: $0 arg1 arg2 arg3" exit 1 fi echo $0 echo $1 $2 $3 echo $*