VERY SERIOUS rmdir bug
Daniel R. Levy
levy at ttrdc.UUCP
Wed Aug 20 10:46:21 AEST 1986
In article <236 at bsdpkh.UUCP>, latham at bsdpkh.UUCP (Ken Latham) writes:
>>try this one:
>> $ mkdir foo
>> $ cd foo
>> $ (cd ..; rmdir foo)
>>then try
>> $ pwd
>> $ l
>> $ cd ..
>>
>>this is great fun!
>
>..... NO it's SHELL !!!!
>
>these two are "BUGS" in shell not 'RMDIR' ( not technically though )
>
>When you remove the cwd from inside shell, you strand yourself there.
>Ksh does not have these problems.
> Ken Latham, AT&T-IS (via AGS Inc.), Orlando , FL
Not really. In SysV or other /bin/sh you're not stranded; you can get out
by specifying a fully qualified pathname (e.g., cd /tmp or cd $HOME). Also
in some (all?) BSD systems, "pwd" is not a Bourne shell builtin.
Besides, even in ksh, the ls and cd commands will fail miserably when used
relative to a directory you are in that has been removed. Wouldn't it be
better for ksh 'pwd' and 'cd' to warn that the directory was gone, and for
'cd' to also attempt to work figuring that '..' should mean parent directory,
etc.?
--
------------------------------- Disclaimer: The views contained herein are
| dan levy | yvel nad | my own and are not at all those of my em-
| an engihacker @ | ployer or the administrator of any computer
| at&t computer systems division | upon which I may hack.
| skokie, illinois |
-------------------------------- Path: ..!{akgua,homxb,ihnp4,ltuxa,mvuxa,
go for it! allegra,ulysses,vax135}!ttrdc!levy
More information about the Comp.unix.wizards
mailing list