Hi all you bash experts...
I'm trying to write a mail filter shell script to be used from KMail, whereby each incoming mail message will be piped through it. The filter needs to read each line of the message and then write it back suitably modified.
I'm having difficulty with the basics of shell scripting. From what I understand, "read x" will deal with each line as it's piped in, and "echo $x" will generate the output stream for the return pipe. (Are there better alternatives?) But how can I tell when the message has finished? I can't look for empty lines because these occur in the middle of messages.
Can anyone suggest a simple filter script that will take an arbitrary file, line by line, from standard input and pass it on to standard output?
-- GT