what is the command To print script arguments
Answer Posted / shabab
$* and $@ are the right answers
$# - prints out the number of arguments passed
Consider the below code
########################
for i in "$*"
do
print $i
done
for i in "$@"
do
print $i
done
########################
and you call the script by saying
#samp.sh hai welcome to "Unix Forum"
hai welcome to Unix Forum
hai
welcome
to
Unix Forum
The first line is the output by printing out $*
the next four lines are with the help of $@.
So
$* will combine all arguments to a single string
$@ will have each arguments as a seperate string
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
List the three main parts of an operating system command?
What is tty in linux process?
How do I find cpu in linux?
How do I stress test my cpu?
What is make in linux?
How do I do a whois search?
What is parallel ssh?
What is a simple command?
How do I check memory usage on linux?
How compile c++ program in cmd?
What are different command to check ram, process and hdd of linux machine?
What is df command in linux?
How do you grep?
How does case sensitivity affect the way you use commands?
Brief about the command nn?