Jump to content

Talk:Walk a directory/Recursively: Difference between revisions

Line 63:
/tmp/dir2</lang>
Which doesn't seem to do anything unexpected. --[[User:Ledrug|Ledrug]] 17:20, 14 June 2011 (UTC)
 
::::::: I was thinking more like this: <lang bash>#!/usr/bin/bash
mkdir dir1 dir2
cd dir2
ln -s ../dir1
mkdir dir2
cd dir1
(cd -P .; cd ../dir2; pwd -P)
(cd .; cd ../dir2; pwd -P)
</lang> When I run that in the directory /tmp/t, I get: <lang>/tmp/t/dir2
/tmp/t/dir2/dir2</lang> That said, the behavior now is much better than what it used to be. If I remove the second mkdir line, and delete the directories and run that again, I get <lang>/tmp/t/dir2
/tmp/t/dir2</lang> where once upon a time if I did not use cd -P . I would get an error trying to <code>cd ../dir2</code>. --[[User:Rdm|Rdm]] 20:14, 14 June 2011 (UTC)
6,962

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.