This is a discussion on a command line question within the Linux Administration forums, part of the Linux Forums category; I'm a little new at all of this. As such, there have been times when I stray mistakenly from ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I'm a little new at all of this. As such, there have been times when
I stray mistakenly from the # prompt on my terminal into some vague areas on certain programs where all I get is something like this: > or I'll tap the Return key a few times and: > > > > > If I type "quit" or "exit" or hit <Esc> or hit every F key on at the top of the board I still keep getting: > So what gives? In the final analysis I can only dissociate from that ">" prompt by just taking my mouse and clicking into the [X] button at the upper right portion of the window, or Alt F4, to kill the program entirely. What I'm I supposed to type when presented with a > prompt in order to legitimately get something going in order to close out er whatever? Thanks a lot for any assistance that you can provide. (No I'm not using perl. These are sometimes just the odd editor program and the like.) |
|
|||
|
On Sat, 20 Dec 2003 22:26:43 -0800, Rob wrote:
> I'm a little new at all of this. As such, there have been times when I > stray mistakenly from the # prompt on my terminal into some vague areas > on certain programs where all I get is something like this: > > > > > or I'll tap the Return key a few times and: > > > > > > > > > > > > > If I type "quit" or "exit" or hit <Esc> or hit every F key on at the top > of the board I still keep getting: > > > > > So what gives? In the final analysis I can only dissociate from that > ">" prompt by just taking my mouse and clicking into the [X] button at > the upper right portion of the window, or Alt F4, to kill the program > entirely. > > What I'm I supposed to type when presented with a > > > > > prompt in order to legitimately get something going in order to close > out er whatever? Thanks a lot for any assistance that you can provide. > > (No I'm not using perl. These are sometimes just the odd editor program > and the like.) Ctrl-C (Ctrl-D will also work). bash, the shell, is waiting further instructions due to an incomplete statement, and a Ctrl-C will abort the entire command that initiated the ">" prompt. |
|
|||
|
On 20 Dec 2003 22:26:43 -0800, Rob wrote:
> I'm a little new at all of this. As such, there have been times when > I stray mistakenly from the # prompt on my terminal into some vague > areas on certain programs where all I get is something like this: > > > > > or I'll tap the Return key a few times and: > > > Can be caused because you have mismatched quotes. Try a ' or " you pick by looking above the first > |
|
|||
|
Rob wrote:
> I'm a little new at all of this. As such, there have been times when > I stray mistakenly from the # prompt on my terminal into some vague > areas on certain programs where all I get is something like this: > > > [snip] > > So what gives? You've started a shell command that /it/ (the shell) thinks is continued on the next line. Finish the command or abort it, and you'll get back to the normal prompt. Some hints: 1) Environment variable PS1 ($PS1) contains your normal prompt You can set this to whatever makes sense for you, and export it. Take a look at this example... ~ $ ~ $ echo $PS1 \w \$ ~ $ export PS1="Your wish is my command...:" Your wish is my command...:echo "-->" $PS1 "<--" --> Your wish is my command...: <-- Your wish is my command...: 2) Environment variable PS2 ($PS2) contains the line-continuation prompt Like PS1, you can set this to whatever makes sense for you and export it. Here's an example (continueing from above) Your wish is my command...:echo $PS2 > Your wish is my command...:export PS2="Please continue...: " Your wish is my command...:if [ true ] Please continue...: echo TRUE Please continue...: fi bash: syntax error near unexpected token `fi' Your wish is my command...: 3) stty(1) will tell you what the various line editing characters are. On my system, stty -a reports ~ $ stty -a speed 38400 baud; rows 24; columns 80; line = 0; intr = ^C; quit = ^\; erase = ^H; kill = ^U; eof = ^D; eol = <undef>; eol2 = <undef>; start = ^Q; stop = ^S; susp = ^Z; rprnt = ^R; werase = ^W; lnext = ^V; flush = ^O; min = 1; time = 0; -parenb -parodd cs8 -hupcl -cstopb cread -clocal -crtscts -ignbrk -brkint -ignpar -parmrk -inpck -istrip -inlcr -igncr icrnl ixon -ixoff -iuclc -ixany -imaxbel opost -olcuc -ocrnl onlcr -onocr -onlret -ofill -ofdel nl0 cr0 tab0 bs0 vt0 ff0 isig icanon iexten echo echoe echok -echonl -noflsh -xcase -tostop -echoprt echoctl echoke The "intr" line edit command is a ^C (control C), so Your wish is my command...:if [ true ] Please continue...: echo TRUE Please continue...: ^C Your wish is my command...: -- Lew Pitcher Master Codewright and JOAT-in-training Registered Linux User #112576 (http://counter.li.org/) Slackware - Because I know what I'm doing. |