bug-bash
[Top][All Lists]
Advanced

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

question of command cd's option [-e]


From: MaShimiao
Subject: question of command cd's option [-e]
Date: Tue, 15 Jan 2013 10:20:40 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/17.0 Thunderbird/17.0

Configuration Information :
Machine: x86_64
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS:  -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OS        
TYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-redhat-linux-gnu' -DCONF_VENDOR 
='redhat' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAV        
E_CONFIG_H   -I.  -I. -I./include -I./lib -D_GNU_SOURCE -DRECYCLES_PIDS         
 -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protec        
tor --param=ssp-buffer-size=4  -m64 -mtune=generic
uname output: Linux Fedora16-MSM 3.6.10-2.fc16.x86_64 #1 SMP Tue Dec 11         
18:55:03 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
Machine Type: x86_64-redhat-linux-gnu

Bash Version: 4.2
Patch Level: 28
Release Status: release

Description:

I want to use the option [-e] of command cd. But I found I can't use. The 
problem as follows:
     $ cd -P -e Donwloads
     bash: cd: -e: invalid option
     cd: usage: cd [-L|[-P [-e]]] [dir]
     $ cd -Pe Downloads
     bash: cd: -e: invalid option
     cd: usage: cd [-L|[-P [-e]]] [dir]
     $ cd -Pe
     bash: cd: -e: invalid option
     cd: usage: cd [-L|[-P [-e]]] [dir]


and I read the source code of bash, it seems the function internal_getopt 
doesn't deal with option 'e'.
It's a bug or I didn't use it correctly? details as follows:

reset_internal_getopt ();
  while ((opt = internal_getopt (list, "LP")) != -1)
    {
      switch (opt)
        {
        case 'P':
          verbatim_pwd = pflag = 1;
          break;
        case 'L':
          verbatim_pwd = 0;
          break;
        default:
          builtin_usage ();
          return (EXECUTION_FAILURE);
        }
    }
  list = loptend;




reply via email to

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