[wplug] My IP address *only*

Jonathan Billings billings at negate.org
Fri Mar 31 17:40:23 EST 2006


On Mar 31, 2006, at 4:35 PM, Janos Dohanics wrote:

> I wanted to extract my system's IP address only and came up with:
> ifconfig rl0 | grep "\<inet\>" | cut -d " " -f 2
> Is there a more direct way to do this?

Extracting it from the output of ifconfig is probably the best way to  
do it, any helper utilities are probably wrappers around ifconfig.

> And a second question: How can I customize my crontab's subject line?

I assume you mean the mail sent by cron.  I don't believe you can  
change this in an individual crontab, however you can probably alter  
the subject by running crond with the -m flag and pass it a special  
program that runs sendmail while setting a certain subject.  This  
would affect all mail sent by cron.

One of the ways to avoid all this is to not leave it up to cron to  
send the mail.  Either have the program itself generate the email, or  
pipe the output of the program to a mailer with the appropriate flags  
to set the subject, like "mail -s <subject> foo at bar.com".

--
Jonathan Billings <billings at negate.org>




More information about the wplug mailing list