Easy Auto Gen quote's for email signature

Write tutorials for Linux Mint here
More tutorials on https://github.com/orgs/linuxmint/discu ... /tutorials and (archive) on https://community.linuxmint.com/tutorial
Forum rules
Don't add support questions to tutorials; start your own topic in the appropriate sub-forum instead. Before you post read forum rules
Post Reply
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Easy Auto Gen quote's for email signature

Post by marcus0263 »

Personally I love this -

1) Crack open a text editor, my favorite is vi
2) Here's a copy of my bash script -

Code: Select all

#!/bin/bash
echo `/usr/bin/fortune -n 150 -s -e politics familyguy homer dubya calvin` | cat /home/username/.signature.tag - > /home/username/.signature
3) Save as something like
email-sig.sh

4) Make it executable

5) Edit /etc/crontab

Code: Select all

#min    hour   date     mon     wkday   command
*/5     *       *       *       *       root    /usr/sbin/email-sig.sh
Then point your email client to your signature, which in my case is /home/username/.signature

To check the options for fortune just hit the man page -

Cheers
antiquexray
Level 5
Level 5
Posts: 604
Joined: Sat Nov 18, 2006 6:04 pm
Location: Albert Lea Minnesota USA

Re: Easy Auto Gen quote's for email signature

Post by antiquexray »

marcus0263 wrote: 4) Make it executable
Question...how does one make a file executable?
User avatar
Fragadelic
Level 4
Level 4
Posts: 244
Joined: Wed Nov 15, 2006 11:05 am
Location: Canada
Contact:

Post by Fragadelic »

chmod a+x filename

This will make it executable for everyone.
User avatar
marcus0263
Level 4
Level 4
Posts: 365
Joined: Mon Dec 25, 2006 9:40 am
Location: Seattle
Contact:

Re: Easy Auto Gen quote's for email signature

Post by marcus0263 »

antiquexray wrote:
marcus0263 wrote: 4) Make it executable
Question...how does one make a file executable?

Code: Select all

chmod 755 filename.sh

Here's a quick reference chart, actually doing it by the numbers is the easiest. Once you get used to it it's a snap.

Code: Select all

Number  	Read (R)  	Write (W)  	Execute (X)
0                		No 		    No                No
1                		No 		    No                Yes
2                		No 		    Yes               No
3                		No 		    Yes               Yes
4               		Yes 		    No                 No
5               		Yes 		    No                 Yes
6               		Yes 		    Yes                No
7                		Yes 		    Yes                Yes
So, for example:

777 is the same as rwxrwxrwx

755 is the same as rwxr-xr-x

666 is the same as rw-rw-rw-

744 is the same as rwxr--r--
User avatar
clem
Level 12
Level 12
Posts: 4308
Joined: Wed Nov 15, 2006 8:34 am
Contact:

Post by clem »

Post Reply

Return to “Tutorials”