Here's one for the first Monday.
cal 3 2000 | awk '/^ [0-9]/ {print $2;exit}'
explanation: get first line starting with a space and number
and print the second field and exit
On Mon, Sep 23, 2002 at 12:49:47PM +1000, Matthew Hannigan wrote:
>
> cal 3 2000 | awk 'NF >= 2 {m=$2} END {print m}'
for every line with at least 2 fields, set m
to the value of the second field. at the end,
print the value of m
--
SLUG - Sydney Linux User's Group - http://slug.org.au/
More Info: http://lists.slug.org.au/listinfo/slug