Path: utzoo!attcan!uunet!brunix!doorknob!jak From: jak@cs.brown.edu (Jak Kirman) Newsgroups: comp.unix.shell Subject: Re: Csh: first character of an arg is '-': Solution Message-ID: Date: 7 Oct 90 15:54:58 GMT References: Sender: news@brunix.UUCP Reply-To: jak@cs.brown.edu Distribution: comp Organization: Department of Computer Science, Brown University Lines: 20 In-reply-to: jak@cs.brown.edu's message of 7 Oct 90 04:18:15 GMT The test to see whether the first character of $i was '-' should have been if ( x$i =~ x-* ) then not if ( $i =~ -* ) then Several of the original replies used this, but I mistakenly thought it was unnecessary, since it worked without it too. But as was pointed out to me, if $i has a special meaning to the shell, like -e or -x etc, it will complain about the lack of a filename to do the existence or executability test on. Adding something like an 'x' or a " " before both tests will solve this problem. Sorry about the incorrect simplification of your answers :-) Jak jak@cs.brown.edu ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ For the female of the species is more deadly than the male. -- Kipling, "The Female of the Species"