a command line question

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


Go Back   Usenet Forums > Linux Forums > Linux Administration

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-21-2003
Rob
 
Posts: n/a
Default a command line question

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.)
Reply With Quote
  #2 (permalink)  
Old 12-21-2003
Me
 
Posts: n/a
Default Re: a command line question

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.
Reply With Quote
  #3 (permalink)  
Old 12-21-2003
Bit Twister
 
Posts: n/a
Default Re: a command line question

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 >
Reply With Quote
  #4 (permalink)  
Old 12-21-2003
Rob
 
Posts: n/a
Default Re: a command line question

Thank you both.
Reply With Quote
  #5 (permalink)  
Old 12-22-2003
Lew Pitcher
 
Posts: n/a
Default Re: a command line question

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.

Reply With Quote
  #6 (permalink)  
Old 12-28-2003
Rob
 
Posts: n/a
Default Re: a command line question

Lew, thank you. This helps further my understanding of what's going on.
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 04:16 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0