[TriLUG] Bash Symbolic Link Traversal Question

Ken Mink ken.mink at gmail.com
Thu Jul 5 11:44:07 EDT 2012


Hey Folks,
    I've been doing a lot of googling on this problem and can't seem to 
find a bash setting to make me happy.
I do the following:
mkdir /tmp/dir1
mkdir /tmp/dir2
echo "Testing 1 2 3" > /tmp/dir1/test
ln -s /tmp/dir2 /tmp/dir1/dir2
cd /tmp/dir1/dir2
cat ../test

I'm running Ubuntu 12.04 and using bash and I get "cat: ../test: No such 
file or directory". Tab completion found 'test', but cat did not. cat 
looked in /tmp since it's the parent directory of the real dir2 not in 
/tmp/dir1 which is the parent directory of the symbolic link dir2 that I 
traversed.

I swear this has worked in the past. Does anyone know if it's possible 
to make this work?

Thanks,
Ken



More information about the TriLUG mailing list