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.?

Answers were Sorted based on User's Feedback



How do you print the output the same string which is typed in command line. how do you write the sh..

Answer / santana20142003

$read line ---> it will read
$ echo $line ---> it will display

Is This Answer Correct ?    6 Yes 0 No

How do you print the output the same string which is typed in command line. how do you write the sh..

Answer / asit

echo "$*"

Is This Answer Correct ?    1 Yes 0 No

How do you print the output the same string which is typed in command line. how do you write the sh..

Answer / 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

More Shell Script Interview Questions

Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.

0 Answers   Cap Gemini, Wipro,


Is shell scripting a language?

0 Answers  


Is cmd a shell?

0 Answers  


What is ms powershell?

0 Answers  


Why are there shells on the beach?

0 Answers  






What is shell chemistry?

0 Answers  


What are the four fundamental components of every file system on linux?

0 Answers  


I Forgot My Windows Vista Password! How Can I Find My Windows Lost Password?

1 Answers  


What are the advantages of shell script?

0 Answers  


Why do we use shell scripting?

0 Answers  


What is @echo off?

0 Answers  


Explain about "s" permission bit in a file?

0 Answers  


Categories