Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!decwrl!decvax!purdue!umd5!mimsy!chris From: chris@mimsy.UUCP (Chris Torek) Newsgroups: comp.unix.questions Subject: Re: bourne and korn shell incompatibilities Message-ID: <10423@mimsy.UUCP> Date: 1 Feb 88 23:26:52 GMT References: <674@pttesac.UUCP> <391@dplace.UUCP> <1450@quacky.mips.COM> Organization: U of Maryland, Dept. of Computer Science, Coll. Pk., MD 20742 Lines: 32 Keywords: sh ksh In article <1450@quacky.mips.COM> dce@mips.COM (David Elliott) writes: >The following will also work.... > > case "`echo *.c`" in > '*.c') > echo "no files" > ;; > *) > echo "files found" > ;; > esac Actually, if you have exactly one file, called `*.c', this will claim there are no files. To fix this you could use case "`echo *.c`" in "*.c") if [ -f "*.c" ]; then echo files found else echo no files fi;; *) echo files found;; esac although this seems like overkill, in general. Thinking about a shell with built-in exception handling, -- In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163) Domain: chris@mimsy.umd.edu Path: uunet!mimsy!chris