[Bug 520096] Re: for zsh cnf_command is populated with incorrect value
Alex Jurkiewicz
alex at bluebottle.net.au
Sun Aug 14 23:03:58 UTC 2011
** Branch linked: lp:~alex-bluebottle/+junk/cnf-520096
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to command-not-found in Ubuntu.
https://bugs.launchpad.net/bugs/520096
Title:
for zsh cnf_command is populated with incorrect value
Status in Automatic command lookup from available packages:
In Progress
Status in “command-not-found” package in Ubuntu:
In Progress
Bug description:
Binary package hint: command-not-found
for 'echo|cat' cnf_command is assigned value 'echo|cat'. Expected
assignment is 'echo'.
Example:
[ytti at lintukoto ~/tmp/FOO]% ls
[ytti at lintukoto ~/tmp/FOO]% find|grep foo
find|grep: command not found
[1 ytti at lintukoto ~/tmp/FOO]% find |grep foo
[1 ytti at lintukoto ~/tmp/FOO]% function cnf_preexec() {
function> typeset -g cnf_command="${2%% *}"
function> }
[ytti at lintukoto ~/tmp/FOO]% find|grep foo
[1 ytti at lintukoto ~/tmp/FOO]%
It is important to test with command which returns non-true value. Above it is unexpected that 'find|grep' is printed with 'command not found' obviously such command does not exist.
"${1%% *}" appears to want white-space or new line to split, ending command with | will incorrectly continue match further
Note, I'm not ZSH literate, I'm not recommending that the fix presented above is used as-is.
ProblemType: Bug
Architecture: amd64
CheckboxSubmission: 27ea4f2fd44978993c33d11dbccf69e2
CheckboxSystem: b845c366ea09c60efa3a45c1b5b21525
Date: Wed Feb 10 23:03:46 2010
DistroRelease: Ubuntu 10.04
Package: command-not-found 0.2.40ubuntu1
PackageArchitecture: all
ProcVersionSignature: Ubuntu 2.6.32-12.17-generic
SourcePackage: command-not-found
Uname: Linux 2.6.32-12-generic x86_64
To manage notifications about this bug go to:
https://bugs.launchpad.net/command-not-found/+bug/520096/+subscriptions
More information about the foundations-bugs
mailing list