This is more of a reminder to myself than anything else. When I am working directly on the Linux server (Centos is my flavor of choice), I often need to find a line number. I have used vi and other editors for a long long time (since the days when unicorns wandered the earth), but I still forget some things. Like today, I had to look up how to turn on line numbers in vi.
This was a quick and dirty bash shell for send email from a command line. The body of the email was the same, and the email was going out to a bunch of people.
Using vi, I created a file in /home/tmp/mailmessages with the body of what I want to write. For this example it is /home/tmp/mailmessages/myFileTellingEveryone
Then I created the following bash script, name mymailer and put in the /bin or /sbin directory:
#!/bin/bash
IFS=":-;"
#FILE= "/home/tmp/mailmessages/$3"
#echo $(basename "$2")
mail -s $(basename "$2") $(basename "$1") < /home/tmp/mailmessages/$(basename "$3")
Do a chmod so that you can execute it (chmod 777 works for me) and now all I do is type:
#mymailer me@me.com "This is my Subject" myFileTellingEveryone
I just keep changing the email address and I can send out this way.