Mostrando entradas con la etiqueta shell scripting. Mostrar todas las entradas
Mostrando entradas con la etiqueta shell scripting. Mostrar todas las entradas

viernes, 11 de septiembre de 2009

Attach a file to a mail on shell

In the old times we were able to attach a file using the mail command. Now, we can do the same thing using mutt:

$ echo "Mail body" | mutt -s "This is a mail with attachments" -a ~/mi_file.txt -a ~/mi_picture.png anne@octop.us
$ _


We can also use some pre-written file to use as the email body:

$ mutt -s "Mail with body from a file" anne@octop.us < ~/mail_body.txt
$ _

lunes, 27 de julio de 2009

Get IP address of a host

If you need to get the IP address of a host, but you don't want to parse the output of ifconfig, you can use hostname:

$ hostname -i
192.168.1.160
$ _