Path: utzoo!mnetor!uunet!lll-winken!lll-tis!ames!umd5!brl-adm!adm!rbj@icst-cmr.arpa From: rbj@icst-cmr.arpa (Root Boy Jim) Newsgroups: comp.unix.questions Subject: Empty Directory? (Was: Picking a character from a word) Message-ID: <13241@brl-adm.ARPA> Date: 3 May 88 20:33:06 GMT Sender: news@brl-adm.ARPA Lines: 22 From: Juergen Wagner Date: 28 Apr 88 22:29:13 GMT set nonomatch if ( ! -e $dir/* ) echo $dir is empty. Didn't work under 4.3 BSD. How about a two-step solution? ls -A $dir > /tmp/$$ if ( -z /tmp/$$ ) echo directory empty Csh needs a few other operators, such as a test for symbolic links. Juergen "Gandalf" Wagner, gandalf@csli.stanford.edu Center for the Study of Language and Information (CSLI), Stanford CA (Root Boy) Jim Cottrell National Bureau of Standards Flamer's Hotline: (301) 975-5688 The opinions expressed are solely my own and do not reflect NBS policy or agreement I represent a sardine!!