From: Zebrouvis, Lois (zebrouvis@PPG.COM)
Date: Thu May 22 2003 - 10:03:22 EDT
if [ `cat file | wc -l` -eq 22 ]
then
whatever
fi
-----Original Message-----
From: John Dunn [mailto:john.dunn@SEFAS.CO.UK]
Sent: Thursday, May 22, 2003 9:57 AM
To: aix-l@Princeton.EDU
Subject: scripting question
Is it possible to write a one line command that will test whether a file
contains a specific number of lines, returning 0 if it dies, 1 if it doesn't
I've been playing around with wc and test with no luck.
John
This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:51 EDT