Write a bash script that prints “My name is $1 and I am $2 years old.” where $1 and $2 are the first and second arguments passed to the script, respectively. The script should not print any additional characters or whitespace.
Additionally, check that the number of arguments passed to the script is exactly 2. If the number of arguments is different, print the following error message: “name_of_script_here error: you must supply two arguments” (where name_of_script_here
is the name of the script, dynamically determined).
$ ./script-args Alice
"name_of_script_here error: you must supply two arguments"
$ echo $?
1
$ ./script-args Alice 30
My name is Alice and I am 30 years old.
$ echo $?
0
$ ./script-args Alice 30 40
"name_of_script_here error: you must supply two arguments"
$ echo $?
1