[Konsole-devel] [konsole] [Bug 361835] New: Environment variables inside command line <-e> option are expanded even when they must not

Egor via KDE Bugzilla bugzilla_noreply at kde.org
Fri Apr 15 20:02:19 UTC 2016


https://bugs.kde.org/show_bug.cgi?id=361835

            Bug ID: 361835
           Summary: Environment variables inside command line <-e> option
                    are expanded even when they must not
           Product: konsole
           Version: 2.14.3
          Platform: Mint (Ubuntu based)
                OS: Linux
            Status: UNCONFIRMED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: konsole-devel at kde.org
          Reporter: egor_skriptunoff at myway.com

Any $VAR in command line after <-e> option gets replaced with its value despite
of enclosing with single quotes

Reproducible: Always

Steps to Reproduce:
$ konsole -e bash -c 'echo $SHELL;echo '\''$SHELL'\'';read'

Actual Results:  
/bin/bash
/bin/bash

Expected Results:  
/bin/bash
$SHELL

1. Lets consider the following command:
echo $SHELL;echo '$SHELL';read
It prints two lines: expanded and non-expanded $SHELL
First line of output: /bin/bash
Second line of output: $SHELL

2.  Wrap the command from step #1 with single quotes:
'echo $SHELL;echo '\''$SHELL'\'';read'

3. Append <bash -c> to the string from step #2:
bash -c 'echo $SHELL;echo '\''$SHELL'\'';read'
This command does exactly the same as command from step #1.

4. Use some other terminal emulator (for example, xterm) to use command from
step #3 as argument for <-e> option:
xterm -e bash -c 'echo $SHELL;echo '\''$SHELL'\'';read'
It works as expected: it prints expanded $SHELL and non-expanded $SHELL:
/bin/bash
$SHELL

5. Now test the command from step #3 with <-e> option using konsole:
konsole -e bash -c 'echo $SHELL;echo '\''$SHELL'\'';read'
It prints:
/bin/bash
/bin/bash
konsole seems to always expand environment variables in <-e command args>.
This behavior looks like a bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the konsole-devel mailing list