The Real Linux World

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

 



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,

http://www.tldp.org/LDP/abs/html/sha-bang.html

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).
then
lines=$1
else lines=$LINES # Default, if not specified on command line.
fi


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.





[Index of Archives]     [Current Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]     [Fedora Docs]

  Powered by Linux