bug-bash
[Top][All Lists]
Advanced

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

functions sometimes less useful than aliases


From: felix . bashbug
Subject: functions sometimes less useful than aliases
Date: Sat, 7 Aug 2004 02:58:38 -0700 (PDT)

Configuration Information [Automatically generated, do not change]:
Machine: i386
OS: linux-gnu
Compiler: i386-redhat-linux-gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='i386' 
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i386-redhat-linux-gnu' 
-DCONF_VENDOR='redhat' -DSHELL -DHAVE_CONFIG_H  -I.  -I. -I./include -I./lib 
-D_FILE_OFFSET_BITS=64 -O2 -g -pipe -march=i386 -mcpu=i686
uname output: Linux stray.canids 2.6.7-1.494.2.2 #1 Tue Aug 3 09:39:58 EDT 2004 
i686 i686 i386 GNU/Linux
Machine Type: i386-redhat-linux-gnu

Bash Version: 2.05b
Patch Level: 0
Release Status: release

Description:

        $ alias s1=sleep
        $ function s2() { sleep "$@"; }
        $ s1 500
        ^Z
        [1]+  Stopped                 sleep 500
        $ s2 500 &
        ^Z
        [2]+  Stopped                 sleep "$@"

        There's no simple way to see what the args of %2 are.  This is
        a problem when I try to use a function like

        $ function p() { less "$@"; }
        
        I end up with a jobs list that's filled with indistinguishable
        instances of 'less "$@"', instead of the easily recognizable
        descriptions I get if 'p' is an alias.

Fix:

        I think I want 'jobs' to show the commands after parameter
        substitution but before globbing.  After globbing might be ok too.
        Maybe this should be an option to 'jobs', like 'jobs -c'.




reply via email to

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