[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

The Real Linux World

Hi All,

tasty heading..? Ok, whilst I enjoy spinning people with the following, "Nah, mate, don't use Windows", which usually gets the suprised response, "oh, what do u use, MAC". Of which I reply, "ah, u all know what I reply with". BUT, I feel I'm not really a Linux person unless I've mastered, Shell Programming, where I believe the real power of Linux World exists. Anyway, enough dribble, and on to my question of the day. I'm following this tut,


and in the code on that page, there is are variables, $1 and $LINES. Um, what are they..?

if [ -n "$1" ]
# Test if command line argument present (non-empty).
else lines=$LINES # Default, if not specified on command line.

and then further down, I see this use of one of them,

tail -$lines messages > mesg.temp # Saves last section of message log file.
mv mesg.temp messages             # Becomes new log directory.

Can anyone explain this in plain English.? I understand that a portion of messages is being written to mesg.temp, and that the rest is deleted. Just don't get where $1 and $LINES is being generated from. Cheers.

Mark Sargent.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]