![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Command to accept input | rexmabry | UNIX for Dummies Questions & Answers | 3 | 02-08-2008 08:56 AM |
| Help-prompt for path and take this as input in find command | bsandeep_80 | UNIX for Advanced & Expert Users | 6 | 01-03-2008 04:16 AM |
| Can give the input to prompt using shell script | Vaibhav Agarwal | Shell Programming and Scripting | 2 | 11-01-2007 12:26 AM |
| Accept input parameters | lloydnwo | Shell Programming and Scripting | 2 | 09-14-2004 04:47 AM |
| Accept user input - only numbers | pvar | Shell Programming and Scripting | 1 | 02-10-2004 08:10 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
How to prompt for input & accept input in ONE line
hi,
am a new learner to shell programming. i have a script which will prompt for user to key in their name & display their name afterwards. script ===== echo "Pls enter your name:" read name echo "Your name is $name." output ===== Pls enter your name: Bob Your name is Bob. what are the modification to be done to the script in order for me to generate out the below output? (to accept the input in the SIMILAR line with the prompt, instead of the next line) output ===== Pls enter your name: Bob Your name is Bob. ur help is much appreciated. Thanks in advanced. |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
Quote:
Code:
echo "Pls enter your name:\c" read name echo "Your name is $name." regards, rishi |
|
#3
|
|||
|
|||
|
Thank you very much, rishi.
appreciate ur prompt reply. |
|||
| Google The UNIX and Linux Forums |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|