For linux. I have not done anything on this. I am in a basic admin linux class so the commands should be simplistic in nature.
the script which accepts any no. of arguments and prints them, and total no. of arguments.
in script added below $* is a special shell variable, it gives token to any no. of argument.
$# is another special shell variable that gives the number of arguments passed.
create a args.sh file using any editor (nano, vi), write the following script, and save the file.
for the file to be executable, use command
chmod +x args.sh
#!/bin/sh
for Token in $*
do
echo $Token
done
echo $#
Screenshots :
Get Answers For Free
Most questions answered within 1 hours.