bug-bash
[Top][All Lists]
Advanced

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

shell-expand-line removes quotes from alias expansion


From: mw-u2
Subject: shell-expand-line removes quotes from alias expansion
Date: Sat, 28 Apr 2007 15:07:52 +0200

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-pc-linux-gnu' 
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL 
-DHAVE_CONFIG_H  -I.  -I../bash -I../bash/include -I../bash/lib  -g -O2
uname output: Linux kleist 2.6.17-2-686 #1 SMP Thu Aug 31 12:53:18 UTC 2006 
i686 GNU/Linux
Machine Type: i386-pc-linux-gnu

Bash Version: 3.0
Patch Level: 16
Release Status: release

Description:
        IMHO shell-expand-line expands some aliases to a different command than
        the command executed by the unexpanded alias.

        I think that shell-expand-line wrongly removes quotes when expanding
        aliases which renders the expanded version unusable under certain
        circumstances.

        I need a certain awk command but sometimes I need to change it a little
        (for example (see below): change the print into print $3). This is why I
        configured an alias and when I need to change it I expand it using C-M-e
        (shell-expand-line) and edit it by hand. Since the quotes are striped by
        the expansion the expanded version is broken.

        I was suggested to use a function instead of an alias but this makes it
        impossible to expand and edit the command in the cases when I need to
        change it.

        I think that shell-expand-line should expand to the same command as the
        one which is executed when shell-expand-line is not called.

Repeat-By:
        $ alias SC='awk '\''!/^#/ {print}'\'''
        $ SC # and hit C-M-e
        # expands to
        $ awk !/^#/ {print}
        # since the '' enclosing !/^#/ which are part of the alias are striped
        # the awk command wont work.

        # I think C-M-e should expand to
        $ awk '!/^#/ {print}'



-- 
"Feel free" - 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail




reply via email to

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