feature request $UNEXPANDED_COMMANDLINE
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
"rm * .o" deletes all files. This is not a bug in rm since bash expands * to match all files. Strictly speaking it isn't a bug in bash either, but it would be nice if bash set a variable such as "UNEXPANDED_
if echo $UNEXPANDED_
echo I don\'t think you wanted to have a space between the '*' and the '.'
else
rm "$@"
done
Note:
1) /proc/$$/cmdline give the expanded cmdline, so that is no use.
2) "set -f" isn't useful, unless I alias every command to do its own (safer) expansion.
3) To reproduce, repeat the following and note that the second ls doesn't see any files
$ ( mkdir -p tmp ; cd tmp && ( touch f.c f.o ; ls ; rm * .o ; ls ) )
f.c f.o
rm: cannot remove `.o': No such file or directory
ProblemType: Bug
Architecture: i386
CheckboxSubmission: 404bd18599e0899
CheckboxSystem: 6944d89cd962d3d
Date: Mon Sep 7 00:10:10 2009
DistroRelease: Ubuntu 9.10
Package: bash 4.0-4ubuntu1
ProcEnviron:
SHELL=/bin/bash
PATH=(custom, user)
LANG=en_AU.UTF-8
ProcVersionSign
SourcePackage: bash
Tags: ubuntu-unr
Uname: Linux 2.6.31-9-generic i686
changed the title to better reflect the feature request.
i agree that stupid rm typos can be disastrous. if it can be done well i might also accept such filtering. but i doubt that it can be done in way that it is really "smart". tools trying to be smarter than the user, when they are not, usually annoy the hell out of me.
that said, i would really like to have a $UNEXPANDED_ COMMANDLINE