Bash question
Hi, I'm writing a script that requires the user to answer y/n
this line.... echo "Do you want to continue(y/n) \c" should produce... Do you want to continue(y/n) with the prompt directly after however I get this Do you want to continue(y/n)\c tried echo -n "Do you want to continue(y/n)" which produces Do you want to continue(y/n)[xxx@xxx] $ which is where I want the prompt to be but without [xxx@xxx] $ TIA WD |
Code:
#!/bin/bash Code:
./continue.sh What type of terminal are you using? echo $TERM |
Hi
What type of terminal are you using? Linux and xterm I set the value of PS1 in my .bash_profile so I dont have to use the bash "bash2.05..." prompt would this be the cause? rh9.0 WD |
Quote:
You need a read command after the echo to have your script waiting for input from the keyboard. If you don't, the script just ends, and the normal shell-prompt appears (after the echoed text, because you used the -n option). |
Thats it!
newbie at this so thought I would see if the -n would give me what the \c was supposed to before doing anything else. lol thanks for the help WD |
All times are GMT -5. The time now is 03:11 PM. |