How do you print the output the same string which is typed
in command line. how do you write the shell script or
command for this. if i entered "Hello" in command line, it
should print 'Hello', if i say "Hello Welcome", i should get
the "Hello Welcome" as output.?
Answer Posted / nirmala
1)If you type "hello" in command line your script should be
written as below
echo $1
2)If you type "hello world" in command line your script
should be written as below
echo $*
3)If you type "hello" and "hello world" in cmd line and
your file name is"string" script is as written below
echo $1
shift 1
echo $*
i/p: string hello hello world
o/p:hello
hello world
Is This Answer Correct ? | 0 Yes | 6 No |
Post New Answer View All Answers
Why is the use of shell script?
What is the best scripting language?
Explain about debugging?
determine the output of the following command: echo ${new:-variable}
What does $1 mean in bash?
Explain about gui scripting?
Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.
How do I stop script errors?
What is batch file programming?
write a shell script to check the failed jobs?
What is shell scripting?
How to write a function?
What is the fastest scripting language?
How do I start a shell script?
Why is it called a shell?