Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!amdcad!ames!lll-tis!ptsfa!pacbell!pb2esac!pttesac!vanam From: vanam@pttesac.UUCP (Marnix van Ammers) Newsgroups: comp.unix.questions Subject: bourne and korn shell incompatibilities Message-ID: <674@pttesac.UUCP> Date: 31 Jan 88 05:01:29 GMT Organization: Pacific*Bell ESAC, San Francisco, Ca. Lines: 33 Keywords: sh ksh Here's an incompatibility between ksh and sh. With ksh, this fails on both the UNIX-PC and the 3B20 if there's more than one *.c file. Works OK with the bourne shell. if [ -f *.c ];then echo "There's a C file in the current directory." else echo "There are no C files in the current directory." fi Apparently the bourne shell permits a test such as if [ -f abc.c def.c xyz.c ] probably by throwing away the def.c and xyz.c . The korn shell calls it a syntax error and fails the test even if the first file exists. I realize that the bourne shell never advertised that multiple arguments were allowed, but it worked, I used it, and now I have a handful of fairly large and often used scripts which I'd like to get working under the ksh. Does anyone have any recommendations as to the best way to make these scripts palatable to the korn shell? -- Marnix (ain't unix!) A. van\ Ammers Work: (415) 545-8334 Home: (707) 644-9781 CEO: MAVANAMMERS:UNIX WORK UUCP: {ihnp4|ptsfa}!pttesac!vanam CIS: 70027,70 HOME UUCP: pttesac!Marnix!vanam