Path: utzoo!utgpu!watmath!clyde!mcdchg!chinet!att!rutgers!tut.cis.ohio-state.edu!cwjcc!gatech!ncar!ames!lll-lcc!lll-winken!arisia!cdp!hemenway From: hemenway@cdp.UUCP Newsgroups: comp.unix.wizards Subject: 4.3bsd sh problems Message-ID: <67700005@cdp> Date: 30 Oct 88 03:51:00 GMT Lines: 32 Nf-ID: #N:cdp:67700005:000:971 Nf-From: cdp.UUCP!hemenway Oct 29 20:51:00 1988 I have been porting some scripts from the System V sh to the 4.3bsd sh and have some problems. Any ideas/explanations would be appreciated. 1. I/O redirection problem: : exec 2> /dev/null echo This message goes to /dev/null as it should. 1>&2 xxabcxx # error message should go to /dev/null--it doesn't < xxabcxx # error message should go to /dev/null--it doesn't The above script sends sh error messages to /dev/null only when stderr is redirected to /dev/null from the command line that called the script. 2. Problem with test -w: When I use the -w primitive with test to test a directory, it reports that the directory is not writeable, regardless of whether it is. The -r primitive works fine with directories. : # if $1 is a directory, this segment reports that $1 is not # writeable, regardless of whether it is if [ -w "$1" ] then echo "write perm" else echo "no write perm" fi Kathy Hemenway {uunet,ucbvax!hplabs}!cdp!sobell!kathy