how to get the last word from file

Ned ngranic at cox.net
Tue Mar 29 18:57:51 EST 2005


... provided that on most systems the last 3 bytes contain the last date of 
a month.
What about this approach:
cal | tail +3 | wc -c
Many ways to do this...

Many Thanks.
Ned
----- Original Message ----- 
From: "Ari Moisio" <arimo at netsonic.fi>
To: "Speakup is a screen review system for Linux." <speakup at braille.uwo.ca>
Sent: Tuesday, March 29, 2005 12:55 PM
Subject: Re: how to get the last word from file


> Hi!
>
>   Quick & dirty:-)
> echo $(cal) | tail -c 3
>
>
> -- 
> arimo
>
> On Tue, 29 Mar 2005, Ned wrote:
>
>> Hi list,
>> I am using the cal command to get current month. What I need for my shell 
>> script is how many days are there in the current month, that is, the last 
>> listed date for that month is that very number.
>> How can I get that number?
>> cal | tail -1
>> and then what?
>>
>> Many thanks!
>> Ned
>> _______________________________________________
>> Speakup mailing list
>> Speakup at braille.uwo.ca
>> http://speech.braille.uwo.ca/mailman/listinfo/speakup
>>
>
> _______________________________________________
> Speakup mailing list
> Speakup at braille.uwo.ca
> http://speech.braille.uwo.ca/mailman/listinfo/speakup 





More information about the Speakup mailing list