Quote:
Originally Posted by arun5002
Hi,
# ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'+
127.0.01
how can i send the output ip address to mail
mail -s 127.0.0.1
|
Not sure what you're asking here. You've got the command string to get the address...so assign it to a variable in your shell script, and use it as you see fit. If you're asking why the mail command isn't working as you've got it, that's a different issue. You're not specifying a subject (fairly sure you don't want it to be the IP address, but that's where you've put it), a recipient address, or the message body, which will definitely hold things up.
There are THOUSANDS of bash scripting tutorials you can easily find on Google. What have you written so far?