My only idea is, rather than have the script look through all the files for aliases, why not make a file of just the names you want left out? That way everything is in one place... this is the change I would make (with alias_file containing the names you want to leave out). for i in `cat alias_file` do ... Just my $0.02 On Fri, Jun 29, 2001 at 10:46:35AM -0500, Jay Kline wrote: > I am working on a cgi script (written using sh) that will output qmail > aliases. I need to create some way to filter the output so that certain > things are not displayed. It needs to eliminate output for: > * aliases that go to /dev/null > * aliases where the name of the alias is contained in the first line of the > file > (eg- $i="john" in the script below, and the file's first line is "johna") > * aliases where the first line of the file is contained in the filename > (eg- $i="johnb" in the script below and the first line of the file is > "john") > > > Does anyone have any ideas? > > The main part of the script looks like this: > > echo "<TABLE BORDER=1>" > for i in $aliases; > do > if [ -n "$nofilter" ]; > then > echo "<TR VALIGN=top><TD>$i</TD>" > echo "<TD><PRE>" > cat /var/qmail/alias/.qmail-$i > echo "</PRE></TD></TR>" > else > if [ -z "`grep /dev/null /var/qmail/alias/.qmail-$i`" ]; then > echo "<TR VALIGN=top><TD>$i</TD>" > echo "<TD><PRE>" > cat /var/qmail/alias/.qmail-$i > echo "</PRE></TD></TR>" > fi > fi > done > echo "</TABLE>" > > -- > Jay > Publishing Business Systems > 651-634-9217 > > _______________________________________________ > tclug-list mailing list > tclug-list at mn-linux.org > https://mailman.mn-linux.org/mailman/listinfo/tclug-list