Public bug reported:
Binary package hint: command-not-found
On a Gutsy box, I was dropped into a root shell when fsck failed.
In that particular situation, you probably don't want to be distracted
by impertinent error messages.
I see that bug #129257 fixes the problem that the command-not-found
output was being printed to standard output. However, I would
additionally like to suggest that it simply stay quiet if not connected
to a terminal. If the command which could not be found is being invoked
from a script, the suggestion to install the missing package is rarely
what is needed or expected, and even less so if the problem is with the
PATH.
For the record, the single-user root shell runs with a PATH which does
not include /usr/bin, and yet there are commands from /usr/bin such as
lesspipe being invoked from root's standard .bashrc. Perhaps these
should be conditional etc; if requested, I will file a separate bug
about that.
vnix$ PATH=/sbin:/bin:/usr/games
vnix$ lesspipe
Command 'lesspipe' is available in '/usr/bin/lesspipe'
The command could not be located because '/usr/bin' is not included in the PATH
environment variable.
bash: lesspipe: command not found
vnix$ eval "$(lesspipe)"
bash: lesspipe: command not found
bash: Command: command not found
bash: The: command not found
vnix$ fgrep lesspipe /root/.bashrc
# make less more friendly for non-text input files, see lesspipe(1)
[ -x /usr/bin/lesspipe ] && eval "$(lesspipe)"
** Affects: command-not-found (Ubuntu)
Importance: Undecided
Status: New
--
Wishlist: don't print anything if not connected to a terminal
https://bugs.launchpad.net/bugs/212405
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs