Write a bash script that prints to the standard output (screen/terminal) Number
ID: 3828938 • Letter: W
Question
Write a bash script that prints to the standard output (screen/terminal) Number of arguments that were passed to it as positional parameters the first and third argument passed to it as one of the positional parameters the last arguments that was pass to it as the positional parameters or a message to the standard error that "No arguments has been received, " if it is a case For this problem, you may find useful to use bash variable $ {! name}, which means the value of the parameter whose name is $name This works when $name is either a named parameter or a number (denoting a positional parameter). Another way would be to use bash variable BASH ARGV or shift command.Explanation / Answer
echo "Number of Arguments: $#"
echo "First and Third Arguments are: $1,$3"
echo "Last Argument is: ${@:${#@}}"
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.