a command line question - Linux

This is a discussion on a command line question - Linux ; 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: ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: a command line question

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

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

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

  4. Re: a command line question

    Thank you both.

  5. 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 = ;
    eol2 = ; 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.


  6. Re: a command line question

    Lew, thank you. This helps further my understanding of what's going on.

+ Reply to Thread