Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

What is the default shell of solaris?

0 Answers  


What is path in shell script?

0 Answers  


HOW TO CREATE 10 USERS IN UNIX(HP-UX) USING SHELL SHELL SCRIPT?

3 Answers   Patni,


What are the advantages of using shell scripts?

0 Answers  


write a shell script to check whether all the directories in the path exist has read and write permission

1 Answers  


What is the difference between running a script as ./scriptname.sh and sh scriptname.sh

1 Answers  


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

0 Answers  


I want to read all input to the command from file1 direct all output to file2 and error to file 3, how can I achieve this?

1 Answers  


what are special characters and explain how does text varies by the usage of single quotes,double quotes and back quotes?

1 Answers  


In a file , how to retrieve the lines which are the multiples of 50 ? like 50,100,150th lines etc.

9 Answers   Amazon,


What is shell variable?

0 Answers  


How do I read a .sh file?

0 Answers  


Categories