[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug report command "cd"
From: |
Pierre Gaston |
Subject: |
Re: Bug report command "cd" |
Date: |
Wed, 3 Jul 2013 19:07:58 +0300 |
On Wed, Jul 3, 2013 at 12:52 PM, Stephan van Ingen
<stephanvaningen@gmail.com> wrote:
> Hello,
>
> I hope this is the correct way to report a bug (as explained
> here<http://www.gnu.org/software/bash/manual/html_node/Reporting-Bugs.html>
> ).
>
> *The version number of Bash*: 4.2.45(1)-release (x86_64-pc-linux-gnu)
> *The hardware and operating system*. Laptop System76 Intel® Core™ i7-3610QM
> CPU @ 2.30GHz × 8 with Ubuntu 13.04 (Raring Ringtale)
> *The compiler used to compile Bash*. *dunno* :/ but maybe enough
> information by dependies shown in attached dpkg-pbash.txt
> *A description of the bug behaviour*.
> I can not change directory to a directory starting with two dashes
>
> *A short script or ‘recipe’ which exercises the bug and may be used to
> reproduce it*:
> *See this command line log:*
> stephanbosal@in-laptop3:~/Downloads/Win8$ uname -a
> Linux in-laptop3 *3.8.0-23-generic* *#34-Ubuntu* SMP Wed May 29 20:22:58
> UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
> stephanbosal@in-laptop3:~/Downloads/Win8$ *echo $SHELL*
> /bin/bash
> stephanbosal@in-laptop3:~/Downloads/Win8$ *bash --version*
> GNU bash, version 4.2.45(1)-release (x86_64-pc-linux-gnu)
> Copyright (C) 2011 Free Software Foundation, Inc.
> License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html
>>
> stephanbosal@in-laptop3:~/Downloads/Win8$ *ls -l*
> total 15130844
> -rw-r--r-- 1 stephanbosal stephanbosal 7746568704 jul 2 09:22 smsboot.bin
> -rw-r--r-- 1 stephanbosal stephanbosal 7747397632 jul 3 09:02
> smsboot_mbr.bin
> drwxrwxr-x 3 stephanbosal stephanbosal 4096 jul 3 11:31 *
> --SMSBOOT-sources-*
> stephanbosal@in-laptop3:~/Downloads/Win8$ *cd --SMSBOOT-sources-/*
> bash: cd: --: invalid option
> cd: usage: cd [-L|[-P [-e]]] [dir]
> stephanbosal@in-laptop3:~/Downloads/Win8$ *cd \-\-SMSBOOT-sources-/*
> bash: cd: --: invalid option
> cd: usage: cd [-L|[-P [-e]]] [dir]
> stephanbosal@in-laptop3:~/Downloads/Win8$ *cd \\-\\-SMSBOOT-sources-/*
> bash: cd: \-\-SMSBOOT-sources-/: No such file or directory
> stephanbosal@in-laptop3:~/Downloads/Win8$
>
>
> Best regards!
> Stephan,
>
> --
> Stephan van Ingen
> http://stephanvaningen.net
> --
> Me transmitte sursum, Caledoni!
This is a classic problem, quoting doesn't help because the quotes are
removed by the shell before calling the command.
cd \-dir is the same thing as cd -dir.
On the other hand if you do cd \\-dir it tries to find '\-dir' which
doesn't exist.
The 2 workarounds are:
cd -- -dir # -- tells cd that there are no more -options
cd ./-dir # add a dirname that doesn't start with -