The only problem with this is the number and contents of these files are 
constantly changing.  It would be nice to have the script be self containing 
so that when you add a user "john" with aliases "johna" and "johnb" you dont 
have to do it twice.

Jay

On Friday 29 June 2001  8:17 pm, you wrote:
> 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
>
> _______________________________________________
> tclug-list mailing list
> tclug-list at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-list

-- 
Small things make base men proud.
		-- William Shakespeare, "Henry VI"