Bill Campbell wrote: > On Fri, Jan 26, 2007, Dak Ghatikachalam wrote: >> I write shells script extensively , I have noticed >> >> ~ -> gets a subsitution for $HOME >> ~userid - >gets you the $HOME for that user >> >> meaning if you have have logged in as root and if you want to run some >> script on oracle home even though you logged in as root you can simplly >> >> ~oracle/runme.sh -- > will run the runme.sh in Oracle home directory > > While that's true for most shells, bash, csh, tcsh, etc., it > doesn't work on true Bourne /bin/sh shells (e.g. SCO OpenServer > 5.0.6a and earlier and probably others with Bell Labs ancestors).
Not sure what I'm missing, is FreeBSD's /bin/sh shell not "true" Bourne Shell? Was it extended in some way from traditional one? % [EMAIL PROTECTED] uname -spr % FreeBSD 6.2-STABLE i386 % [EMAIL PROTECTED] printenv SHELL % /bin/sh % [EMAIL PROTECTED] cd test % [EMAIL PROTECTED] pwd % /home/karol/test % [EMAIL PROTECTED] cd ~ % [EMAIL PROTECTED] pwd % /home/karol % [EMAIL PROTECTED] cd ~kadu % [EMAIL PROTECTED] pwd % /home/kadu > It's a Good Idea(tm) when writing scripts that may be used on > many systems to program defensively, for the lowest common > denominator to avoid pitfalls like this. > > Bill Agreed. Karol -- Karol Kwiatkowski <karol.kwiat at gmail dot com> OpenPGP 0x06E09309
signature.asc
Description: OpenPGP digital signature