home directory in path fail in BASH
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
bash (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Binary package hint: bash
This complex command works
cp -v "install "* ~/.gnome2/
Now if you do this it works
mkdir ~/.gnome2/
if you try this it fails
mkdir "~/.gnome2/
you get this message
mkdir: cannot create directory `~/.gnome2/
basically the ~ representing the home directory does not get recognized correctly by the command interpreter.
but if you do this it works
mkdir "/home/
where /home/joseph is your own home directory.
doing this doesn't work either in case you thought my syntax is wrong.
mkdir ~"/.gnome2/
mkdir: cannot create directory `~/.gnome2/
I discovered this bug when I started working on nautilus-scripts which are very handy in improving the user interface. While there are work arounds it make the scripting more difficult to program.
This bug isn't only isolated to mkdir command but other commands like cp.
The version of bash loaded on the machine is
bash --version
GNU bash, version 3.2.48(1)-release (i486-pc-linux-gnu)
Copyright (C) 2007 Free Software Foundation, Inc.
ProblemType: Bug
Architecture: i386
DistroRelease: Ubuntu 9.04
ExecutablePath: /usr/bin/yelp
Package: yelp 2.25.1-0ubuntu5
ProcEnviron:
LANG=en_AU.UTF-8
SHELL=/bin/bash
SourcePackage: yelp
Uname: Linux 2.6.28-15-generic i686
A further note if you do this it works .gnome2/ nautilus- scripts/ test directory"
mkdir $HOME"/
This also works correctly
echo ~
As this does to
echo $HOME