bug-bash
[Top][All Lists]
Advanced

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

Re: Filename completion broken on single quote


From: lolilolicon
Subject: Re: Filename completion broken on single quote
Date: Sat, 15 Oct 2011 23:15:24 +0800

On Sat, Oct 15, 2011 at 10:34 PM, lolilolicon <lolilolicon@gmail.com> wrote:
> <snip>
>
>  #!/bin/bash
>
>  shopt -s progcomp
>
>  mkdir -p 1\'1 2@2
>  touch 1\'1/one 2@2/two
>
>  for i in \
>    "1'1" "1\'1" "1'1/" "1\'1/" \
>    "2@2" "2\@2" "2@2/" "2\@2/"; do
>    printf -- '%5s => %s\n' "$i" "$(compgen -f "$i")"
>  done
>  # (Same results using `compgen -o default')
>

In fact, if I simply *remove* the `#!/bin/bash' line, run it the same way,
I will get the same results as I did in the interactive bash shell:

  $ ./test.sh
    1'1 => 1'1
   1\'1 =>
   1'1/ =>
  1\'1/ => 1\'1/one
    2@2 => 2@2
   2\@2 =>
   2@2/ => 2@2/two
  2\@2/ => 2\@2/two

But if I run it explicitly with bash, the results are the same as with
`#!/bin/bash'. (Surprise, surprise...)

  $ bash ./test.sh
    1'1 => 1'1
   1\'1 =>
   1'1/ => 1'1/one
  1\'1/ =>
    2@2 => 2@2
   2\@2 =>
   2@2/ => 2@2/two
  2\@2/ =>

I feel dumb.

(And sorry for being a bit... spammy)



reply via email to

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