Insert date question

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Kevin Brown
Date:  
Subject: Insert date question
tickticker wrote:

> Good evening,
>
> I'm script-challenged, and am having a little issue here.
>
> I have a text file that I would like to update fairly regularly, let's call it
> Update. Every time I update it, I make a copy of it in the form of
> Update_<today's-date>
> so that I have a historical record of what shape the file was in every time I
> updated it.
>
> I was thinking of making a script to do this, but my scripting is lousy. I
> was using emacs (no flames please) to try something along the lines of:
>
> cp Update Update_<code-to-insert-date>
> emacs -nw Update
>
> to first make a dated copy, then open up the original for editing.
>
> Maybe this is sheer laziness, maybe it's learning scripting with baby steps.
> When I take enough baby steps, I hope to have that "AHA!!!" moment of
> comprehension soon.
>
> I've googled, and what looks like might work,
> http://list-archive.xemacs.org/xemacs/199906/msg00337.html for example, I
> don't know how to implement in emacs, and no flames please, emacs is my
> editor of choice (can you tell I'm trying to avoid the "Use VIM!!" comment).
> IANAP (i am not a programmer) and like the interface, but there are some
> aspects of it that elude me, this being one.
>
> Any help would be appreciated,


cp file file_`date +%Y%m%d`.old
vi file