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 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



Relevant Pages

  • Re: select line from file, and then the next line a week later
    ... >> to grab line one the first time I run it, ... I am guessing awk ... Have the script send the email to the ...
    (comp.unix.shell)
  • Re: Loop within (InStr) Loop problem - how do I re-read file in second loop?
    ... On your first time through first time through your ODAS Sub you 'Set' ... the first parameter 'objTextFile2' which at this point is an object and not ... > to have a problem with the script not re-reading the second file. ...
    (microsoft.public.scripting.vbscript)
  • Re: free source for bbs
    ... > did it the first time, fixed that, and I know how they did it the ... > second time because my password for the admin script was something ... But we are not laughing with you. ...
    (comp.lang.perl.misc)
  • Re: [kde-linux] Starting ssh at log-in
    ... convenient as possible without losing that security. ... First, if you use password caching anyway, it is only the first time you are ... previous post that your konsole flicks on the screen and then exits. ... script to run rather than a shell. ...
    (KDE)
  • Re: Support Groups
    ... I missed this the first time I read your post. ... I understood he needed to go through a script. ... fan had failed and the script discovered it was the fan on the video card ... Go with the Small Business Group. ...
    (alt.sys.pc-clone.dell)