Is it possible to make a "file" that can change its output when accessed?
Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Is it possible to make a "file" that can change its output when accessed?
I'm trying to get an email program that doesn't have a random signature feature to use random signatures. All it has is a place to specify a single file as the signature file. Specifying a shell script that will output a random signature doesn't work, I just get part of the shell script as my signature.
Is there some way to create something that will, when accessed as if it were a file, be able to generate different output?
Maybe have a cron job run a script which rotates/randomises where a link goes to on your harddrive, and have the email program use the link file as the sig.
Here's what I do:
Check out: Boris' Taglines
Then each time the tagline is called it generates a random quote into a .signature file, which is then called by my mail program (kmail) each time. Since the .signature file is randomly created each time the tagline is called, I just have to reference to that for my signature
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.