csh and ksh symbolic link differences

csh and ksh symbolic link differences

Post by David D. Hettee » Tue, 16 Jun 1998 04:00:00



Does anyone know why the Korn shell people chose to implement symbolic
links differently than the C shell? For example, if you create a
symbolic link to another directory and then "cd" to the symbolic link
name and then do a "pwd", in C shell you get the actual location that
the link points to; in Korn shell you get the link name.

Example:
% ln -s /home/dave/test test
% pwd
/home/dave/test  (C shell)
/test  (Korn shell)

Is there any way to change Korn shell's default behavior so symbolic
links work the same as C shell? This difference has caused me a lot of
grief since some of our programmers use symbolic links in their software
and C shell is the default shell on the system (Sun). Even though almost
everyone uses C shell, I much prefer using the Korn shell and this is
the only real problem I have run into.

Thanks,
Dave Het*

 
 
 

csh and ksh symbolic link differences

Post by Dan A. Merc » Tue, 16 Jun 1998 04:00:00



: Does anyone know why the Korn shell people chose to implement symbolic
: links differently than the C shell? For example, if you create a
: symbolic link to another directory and then "cd" to the symbolic link
: name and then do a "pwd", in C shell you get the actual location that
: the link points to; in Korn shell you get the link name.

: Example:
: % ln -s /home/dave/test test
: % pwd
: /home/dave/test  (C shell)
: /test  (Korn shell)

: Is there any way to change Korn shell's default behavior so symbolic
: links work the same as C shell? This difference has caused me a lot of
: grief since some of our programmers use symbolic links in their software
: and C shell is the default shell on the system (Sun). Even though almost
: everyone uses C shell, I much prefer using the Korn shell and this is
: the only real problem I have run into.

: Thanks,
: Dave Het*

pwd -P will give you the resolved path name unless you run into the bug
that gives you "ksh: pwd: permission denied" instead. (bug is fixed
in ksh93).

--
Dan Mercer

Opinions expressed herein are my own and may not represent those of my employer.

 
 
 

1. wildcard expansion and symbolic links (csh, sh, ksh, bash)

Obviously I neglected to finish the above sentence.  It should read
"... while csh and ksh behave unexpectedly (at least to me)."

-----------------------------------------------------------------
| John A. Turner                                                |
| Los Alamos National Laboratory, MS B226, Los Alamos, NM 87545 |
| Group: X-6 (Radiation Transport)                              |
| Location: TA-3, Bldg. 43, Rm. D263                            |

-----------------------------------------------------------------

2. Seagage 4324/4326 Tape Drive

3. Too many symbolic links, Symbolic link loop

4. HELP: On Binary I/O, V.35, Modems, IPX

5. ksh to csh and/or csh to ksh

6. C9A0 error code on IBM 7137 dasd subsystem

7. csh -> ksh or ksh -> csh EQUIVALENTS NEEDED....

8. Any PS viewer available in AIX

9. Eterm, Xterm, CSH and Symbolic links

10. How to trick the csh(1) to follow a symbolic link?

11. Csh - How to distinguish between symbolic link and directory in script?

12. symbolic link and .. in csh versus posix shell