-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Wed, 14 Nov 2001, Harry Putnam wrote: >> On Wed, Nov 14, 2001 at 05:26:10PM +0100, Thomas Ribbrock wrote: >>> >>> Well, how about >>> echo `ls ~/mail | grep -v '^sent'` >> >> Damn! I should have thought of that. >> Thanks to both of you. > >Both: >s#Mail/sent## >and >`ls ~/mail | grep -v '^sent'` >Will fail in the event of filenames like `unsent' or `notsent'
Not quite. The pattern '^sent' will not match "unsent" or "notsent". However, it will not perform as intended for files like sent-mail. So how about this: echo `ls ~/mail | grep -v '^sent$'` This pattern anchors both the beginning and the end of the string so only one filename can match. The user may need to look at ways to exclude directories since they do not contain messages. Tony - -- Anthony E. Greene <[EMAIL PROTECTED]> <http://www.pobox.com/~agreene/> OpenPGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26 C484 A42A 60DD 6C94 239D Chat: AOL/Yahoo: TonyG05 Linux. The choice of a GNU Generation. <http://www.linux.org/> -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (GNU/Linux) Comment: Anthony E. Greene <[EMAIL PROTECTED]> 0x6C94329D iD8DBQE78tvjpCpg3WyUI50RAvFgAJ9CIBobr6gyR7HL3n1F395NXA/dqQCfUogo H4EF34oOzwws6/xjxwFnCMc= =3cJ7 -----END PGP SIGNATURE----- _______________________________________________ Redhat-list mailing list [EMAIL PROTECTED] https://listman.redhat.com/mailman/listinfo/redhat-list