![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bash Trap Problem? | jsabino | Shell Programming and Scripting | 3 | 11-17-2008 01:45 PM |
| Bash problem | edgehead | Shell Programming and Scripting | 3 | 11-15-2008 04:34 AM |
| bash array problem | yagnesh | Shell Programming and Scripting | 1 | 08-19-2008 02:48 AM |
| Bash: bad substitution problem...pls help! | xfouxs | UNIX for Dummies Questions & Answers | 1 | 11-23-2007 05:48 PM |
| Bash while loop problem | Kweekwom | Shell Programming and Scripting | 5 | 07-23-2007 12:49 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
problem about '..' in bash
There is an interview question about UNIX bash:
Some shells like bash try to make '..' always work propery, namely, from home directory, cd ../$USER will place you in your home directory. Does bash always get this behavior correct? Anyway can provide any example that bash doesnt work well? Thanks! Last edited by usfish; 02-11-2009 at 02:34 AM.. |
|
||||
|
Quote:
I think there might be chance that bash fails on symbolic link? |
|
|||||
|
Quote:
|
|
||||
|
hmmm
Funny, that looks an awful lot like one of the extra credit questions on my latest 6.033 (MIT Computer Systems Engineering) homework.
Let's clarify the problem. Say we have some arbitrary directory at /some/long/path/name/, and say that our home directory is /home/me/. Now, we do this: Code:
ln -s /some/long/path/name /foo/bar ln -s /home/me /foo/baz Code:
bash cd /foo/bar cd ../baz Ultimately, the question is, does bash always get this behavior correct? When cd-ing to another directory via a symlink, does cd .. always get you back to the directory that contains the symlink? Last edited by larryv; 02-11-2009 at 06:50 PM.. Reason: clarify final sentence |
| Sponsored Links | ||
|
|