![]() |
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 |
| absolute path for Acrobat reader | ramirezmc | UNIX for Advanced & Expert Users | 3 | 10-26-2007 05:04 AM |
| absolute path | Kirichiko | UNIX for Dummies Questions & Answers | 2 | 10-03-2007 06:30 AM |
| absolute path | filedeliver | High Level Programming | 4 | 06-05-2007 05:18 PM |
| vi - replacing a relative path with absolute path in a file | Yinzer955i | UNIX for Dummies Questions & Answers | 2 | 09-07-2006 11:47 AM |
| HOW to make absolute path???? HELP | youngvet | High Level Programming | 1 | 11-01-2003 04:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
$PWD shows absolute path vs path w/symbolic links
We are migrating our App from HP to Sun and I'm experiencing some "strange" behavior in terms of what is returned from pwd (or $PWD)
We have been running under Korn Shell $ cd /SYMBOLIC_LNK/subdir/subdir2/symbolic_lnk $ pwd displays: /SYMBOLIC_LNK/subdir/subdir2/symbolic_lnk $ ksh $ pwd displays the absolute path to the directory - with no symbolic links I have scripts that test the dir name and am expecting the dir to contain the symbolic link, not the absolute path - so these are failing. This worked correctly on HP, but is not working right on Sun cd Is there a way to tell Sun to return the path name with the symbolics intact? Thx, John |
|
||||
|
pwd is both a shell builtin (for ksh) and it is also a shell utility.
The behavior of pwd for the same version of ksh on either box should be the same. Because it is a shell builtin. Are you in the same version of ksh on both boxes, like ksh93 or whatever? If you have POSIX compliant pwd on your Solaris box you can also use pwd -L or pwd -P as an alias to override pwd. |
|
||||
|
seems like that ksh in the middle is causing you the issue. Everything works pretty much like expected until you reset the ksh kernel, which picks up the absolute path at that point. Try changing your directory AFTER you do the ksh command.
I am running the below on a solaris box prdora1: :ll -d /bin lrwxrwxrwx 1 root root 9 Aug 28 2006 /bin -> ./usr/bin prdora1: :cd bin /bin prdora1:bin wd/bin prdora1:bin wd -P/usr/bin prdora1:bin :echo $PWD /bin prdora1:bin :ksh prdora1:bin wd/usr/bin prdora1:bin wd -P/usr/bin prdora1:bin :echo $PWD /usr/bin prdora1:bin wd -L/usr/bin |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|