2 Replies Latest reply on Dec 16, 2013 3:26 PM by VolumetricSteve

    Unusual prompt in text-only mode


      Hey Everyone,


      I'm still getting my bearings in unix/solaris so I'm digging around and experimenting with things.  I've stumbled across a strange problem though..

      I log in normally, then I su - to root, and from what I assume is the bash shell, I do:


      sh -version


      which produces a TON of output and drops me to a > prompt where almost every keystroke produces the appearance of another >


      Some accidental input in the past dropped me to a similar prompt, but it was more interactive and I could issue commands to it...this appears broken.


      I've tried logging into another session (vt2) to find the pid and kill it, but..I'm all but certain I'm doing that wrong too.


      What's going on?


      Thanks in advance.

        • 1. Re: Unusual prompt in text-only mode
          Darren Moffat-Oracle

          There is no '-version' argument to /usr/bin/sh.  /usr/bin/sh is actually ksh93 now in Solaris 11.


          What you have done is run the equivalent of 'sh -v -e -r -i -s -o -n' where the sh man page says:

               -v             Print shell input lines as they are read.
               -e             Exit immediately if a command exits  with  a  non-
                              zero exit status.
               -r             If the -r flag is present the shell is a res-
                              tricted shell (see rsh(1M)).
               -s             If the -s flag is present or if no  arguments
                              remain,  commands  are read from the standard
                              input. Any remaining  arguments  specify  the
                              positional  parameters.  Shell output (except
                              for Special  Commands)  is  written  to  file
                              descriptor 2.
               -i             If the -i flag is present  or  if  the  shell
                              input  and output are attached to a terminal,
                              this shell is interactive. In this case, TER-
                              MINATE  is  ignored  (so that kill 0 does not
                              kill an interactive shell) and  INTERRUPT  is
                              caught and ignored (so that wait is interrup-
                              tible). In all cases, QUIT is ignored by  the
               -n    Read commands but do not execute them.

          A single argument '-version' would be a violation of the POSIX standard options are single - followed by a single letter and multiple letters following each other are as if there was a space and a dash between them.

          Long options with a double leading -- are supported by sh(1) and if you run: sh --version you will find the version of ksh on your shstem that is being used for /bin/sh

          • 2. Re: Unusual prompt in text-only mode

            Thank you!  What's the deal with the > prompt though?  I was reading it may be dropping me to PS2 because it might be awaiting input?  I'm not sure.