[Bug 692554] Re: Autocomplete fails on some filenames

Peter Cordes peter at cordes.ca
Sat Nov 29 02:54:16 UTC 2014


Looked into this some, and I think I might have a fix.  The problem is
the backquote, and what we're seeing here is related to the reports of
completion inside $( failing.

the progcomp code uses a lot of constructs like eval $z=$foo, to assign by reference to a variable whose name is stored as $z.
e.g.
z=myvar
foo='`test'
eval $z="$foo"
bash: unexpected EOF while looking for matching ``'
bash: syntax error: unexpected end of file

 The trick is to single-quote $foo, so parameter expansion doesn't happen on it at the same time as $z.
eval $z='$foo'
echo $myvar 
`test

 I'll post a patch after I go through the file and fix what I find.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to bash-completion in Ubuntu.
https://bugs.launchpad.net/bugs/692554

Title:
  Autocomplete fails on some filenames

Status in bash-completion package in Ubuntu:
  New

Bug description:
  Binary package hint: bash-completion

  After creating a directory or file with the standard escape sequences
  available in the Bash $'' string construct, filename autocompletion
  fails. For example:

  $ mkdir -- $'--$`\! *@ \a\b\e\E\f\r\t\v\\\"\' \n'
  $ rm -- \-\-
  [press TAB]
  $ rm -- \-\-bash: [: --$`\! *@
  : binary operator expected
  --\$\`\\\!\ \*@\ ^G^H^[^[^L^M\ ^K\\\"\'\  

  The good news is, if autocomplete can handle this filename, it should
  be able to handle _any_ *nix filename, that is, anything that doesn't
  contain a null character or a slash.

  ProblemType: Bug
  DistroRelease: Ubuntu 10.04
  Package: bash-completion 1:1.1-3ubuntu2
  ProcVersionSignature: Ubuntu 2.6.32-26.48-generic 2.6.32.24+drm33.11
  Uname: Linux 2.6.32-26-generic i686
  Architecture: i386
  Date: Mon Dec 20 14:05:33 2010
  InstallationMedia: Ubuntu 10.04 LTS "Lucid Lynx" - Release i386 (20100429)
  PackageArchitecture: all
  ProcEnviron:
   LC_PAPER=en_GB.UTF-8
   SHELL=/bin/bash
   LANG=en_US.utf8
  SourcePackage: bash-completion

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/bash-completion/+bug/692554/+subscriptions



More information about the foundations-bugs mailing list