Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"funny feature" in ksh

Status
Not open for further replies.

ogniemi

Technical User
Nov 7, 2003
1,041
PL
root@boxb# pwd
/
root@boxb# ls -ld /usr/123
ls: 0653-341 The file /usr/123 does not exist.
root@boxb# [ -d /usr/123/456/789/../../../bin ]
root@boxb# echo $?
1
root@boxb# cd /usr/123/456/789/../../../bin
root@boxb# echo $?
0
root@boxb# pwd
/usr/bin
 
The cd builtin in ksh apparently 'calculates' where you want it to go, then moves in one swift motion...

The cd in bsh, csh or bash move one dir at a time and will fail on the first non-existent dir.



HTH,

p5wizard
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top