Re: select line from file, and then the next line a week later

From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 01/30/05


Date: Sun, 30 Jan 2005 19:19:26 GMT

On Sun, 30 Jan 2005 10:23:12 +0000, Stephane CHAZELAS <this.address@is.invalid> wrote:
>

<snip>

>
> Or you could even rotate the file (put the first line at the
> end). This way, you don't even need a tempfile:
>
> #! /bin/sh -
> # On solaris, use #! /usr/xpg4/bin/sh -
> file=/path/to/address-list
> {
> IFS= read -r address && {
> cat
> printf '%s\n' "$address"
> }
> } < "$file" 1<> "$file"
> sendmail -t -oi -oem << EOF
> From: The Friday Post Man <some@address.example>
> To: $address
> Subject: Your Friday mail
>
> blah
> EOF
>

The difference between the above and

# #!/bin/sh
#
# list=/path/to/copy/of/list
# body=/path/to/file/with/body/of/mail/with_other_headers
# temp=/path/to/temp/directory
#
# if test -s $list; then
#
# mail -s "your friday mail" -i $body \
# `sed -n '1p' $list` &&
#
# sed '1d' $list > $temp/tempfile$$
# mv $temp/tempfile$$ $list
#
# else
#
# mail -s "ALERT -- Empty Mailing List" his@address.example
#
# fi
#
#

...is that the latter doesn't give one a HEADACHE!
  

:-)

AC



Relevant Pages

  • Re: I know you guys would hate me for this....
    ... usually just snip them. ... the reason why we are responding to it, but merely responding for the sake ... of being sensitive to your cat. ... If Ranmao wants a hug, ...
    (rec.games.computer.ultima.dragons)
  • Re: Idle Kellys silly, polemical self
    ... I could assure you that its not ... No, I don't own her, but my best friend is my hostess's cat, Dusty. ...
    (soc.religion.quaker)
  • Re: paintComponent into a BuffereImage?
    ... It is therefore not a good idea to create a new BufferedImage each ... to rotate a JTextPane by 90 or 180 degrees. ... I can't use a JLabel (which I CAN rotate) because I need the text to ...
    (comp.lang.java.help)
  • Re: Domestic cat problems
    ... made all the inflamatory posts. ... if all the cat owners here would like to pop around to tehir ... at the park - wherever you cross the path of a random cross ...
    (uk.legal)
  • Re: What is wrong with this simple command?
    ... grepping this text file for a string via exec works fine. ... Also you may want to use the open, read, and close commands instead of cat. ...
    (comp.lang.tcl)