Re: select line from file, and then the next line a week later
From: Alan Connor (zzzzzz_at_xxx.yyy)
Date: 01/30/05
- Next message: Keith Thompson: "Re: newbie question: simulating wildcards with piping"
- Previous message: erik: "select line from file, and then the next line a week later"
- In reply to: erik: "select line from file, and then the next line a week later"
- Next in thread: Stephane CHAZELAS: "Re: select line from file, and then the next line a week later"
- Reply: Stephane CHAZELAS: "Re: select line from file, and then the next line a week later"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 30 Jan 2005 04:56:58 GMT
On 29 Jan 2005 20:11:37 -0800, erik <ewitkop90@hotmail.com>
wrote:
> Let's say I have a file of 5 email addresses. What if I wanted
> to email one person on the list, in sequence, every friday.
> So on the first friday, I would email the first person. The
> following friday I would email the second person, and so on....
>
> Now I could cron it for friday, but how can I get the script
> to grab line one the first time I run it, then grab line 2 the
> next time I run it. Is this even possible?
>
> I don't think 'case' can do this for me. I am guessing awk
> might be able to, but I am no good at awk.
>
Here's one way to do this, Erik.
Create a copy of the file. Have the script send the email to the
first line in the copy. Delete the first line just before the
script exits.
sed '1d' filename > tempfile; mv tempfile filename
AC
- Next message: Keith Thompson: "Re: newbie question: simulating wildcards with piping"
- Previous message: erik: "select line from file, and then the next line a week later"
- In reply to: erik: "select line from file, and then the next line a week later"
- Next in thread: Stephane CHAZELAS: "Re: select line from file, and then the next line a week later"
- Reply: Stephane CHAZELAS: "Re: select line from file, and then the next line a week later"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|