bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bash -c string #: prefixes output with a [prompt?] string


From: John Snyder
Subject: bash -c string #: prefixes output with a [prompt?] string
Date: Fri, 14 Sep 2001 15:12:10 -0400 (EDT)

From: jjs@research.att.com

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: Linux
Compiler: gcc
Compilation CFLAGS:   -DHAVE_VFPRINTF -DHAVE_UNISTD_H -DHAVE_STDLIB_H -DHAVE_LI\
MITS_H        -DHAVE_GETGROUPS -DHAVE_RESOURCE -DHAVE_SYS_PARAM -DVOID_SIGHANDL\
ER -DHAVE_GETDTABLESIZE -DHAVE_BCOPY -DHAVE_GETPW_DECLS -DHAVE_GETHOSTNAME -DHA\
VE_WAIT_H         -DHAVE_DUP2 -DHAVE_STRERROR  -DHAVE_DIRENT_H -DHAVE_STRING_H \
        -DHAVE_VARARGS_H -DHAVE_STRCHR  -DHAVE_DEV_FD        -Di386 -DLinux 
-DSH\
ELL -DHAVE_ALLOCA -DHAVE_ALLOCA_H       -O2 -m486 -fno-strength-reduce
uname output: Linux rh62 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown

Bash Version: 1.14
Patch Level: 7

Description:

        When a user's login shell is /bin/bash, output from the command

                bash -c pwd

        is prefixed with the [prompt?] string  "^[]2;\h^G", for example:

                [jjs@rh62 jjs]$ bash -c pwd
                ^[]2;rh62^G/home/jjs

        FYI:  uname -a
        Linux rh62 2.2.14-5.0 #1 Tue Mar 7 21:07:39 EST 2000 i686 unknown

Repeat-By:

        Use chsh to set or change the user's login shell to /bin/bash;
        Login as that user;
        At the prompt, type in the any of the following commands:

                bash -c pwd          or  $SHELL -c pwd
                bash -c date         or  $SHELL -c date
                bash -c 'echo hi'    or  $SHELL -c 'echo hi'
                bash -c echo         or  $SHELL -c echo

        and observe the output.

        Some Workarounds:
                
                If /bin/sh is linked to /bin/bash,
                use  sh  or  /bin/sh  in place of  bash.
                
                If /bin/sh is linked to /bin/bash,
                use  chsh  to change the users' login shell to  /bin/sh
                (or  /bin/ksh  ... ).

        If there is code that uses  "$SHELL -c cdm_string" and
        one cannot guarantee that the user's login shell will
        not be  /bin/bash ,  it may not be so easy.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]