On Mon, 15 Sep 2003 20:21:13 -0400
Gonzalo Avaria <[EMAIL PROTECTED]> wrote:
> Hi experts
> I have a little question, i would like to have a script on the startup (could
> be init.d) that should do two command lines:
>
> /sbin/ifconfig eth0 | fgrep -i inet | cut -d : -f 2 | cut -d \ -f 1 &>
> ipnumero
> mail -s "IP Number" [EMAIL PROTECTED] < ipnumero
>
> I don_t know how to do a script, and have been looking but with no success.
> So, anyone can tell me where should i go to have an answer or someone can help
> me with this???
> Thank you for your time
>
> --
> Gonzalo Avaria S.
> Linux User from the end of the World
> CHILE
>
>
hi ! man chkconfig will help you
about the command itself, you could use bash to get the same result. about 4x faster
...
set -- $(/sbin/ifconfig eth0 2>/dev/null); echo ${7//[^0-9.]/}
set cuts stdout from ifconfig into positional parameters, according to $IFS. the
interesting parameter is $7 on my system (locales = FR). echo ${7//[^0-9.]/} shows
only the ip part (cyphers+dots) from it.
bye
jipe
Want to buy your Pack or Services from MandrakeSoft?
Go to http://www.mandrakestore.com