Mailing List Archive
tlug.jp Mailing List tlug archive tlug Mailing List Archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]Re: [tlug] Setting Date Variable for Cron Job
- Date: 17 Jun 2002 16:57:44 +0900
- From: "Stephen J. Turnbull" <stephen@example.com>
- Subject: Re: [tlug] Setting Date Variable for Cron Job
- References: <20020617.164612.74750663.acmuller@example.com>
- Organization: The XEmacs Project
- User-agent: Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.4 (Informed Management (RC0+))
>>>>> "Charles" == Charles Muller <acmuller@example.com> writes: cp -f /home/chuck/.emacs /home/chuck/Documents/programming/emacs-`date+"%Y%m%d"`.txt (1) As a matter of style, you should put the `+' inside the "". (2) You don't need the "". (3) You _do_ need a space between the "data" and the "+" -- it's protected by the backquotes, so it doesn't break up the file name. (4) You should get in the habit of doing this in stages, eg TIMESTAMP=`date+"%Y%m%d"` cp -f /home/chuck/.emacs /home/chuck/Documents/programming/emacs-$TIMESTAMP.txt The reason is that as you start doing more complex things, you'll want to manipulate the same file later, eg TIMESTAMP=`date+"%Y%m%d"` cp -f /home/chuck/.emacs /home/chuck/Documents/programming/emacs-$TIMESTAMP.txt gzip -9 /home/chuck/Documents/programming/emacs-$TIMESTAMP.txt There are ways to do this without the variable, but they're either less reliable, or harder to understand and debug. -- Institute of Policy and Planning Sciences http://turnbull.sk.tsukuba.ac.jp University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN My nostalgia for Icon makes me forget about any of the bad things. I don't have much nostalgia for Perl, so its faults I remember. Scott Gilbert c.l.py
- Follow-Ups:
- Re: [tlug] Setting Date Variable for Cron Job
- From: Stephen J. Turnbull
- Re: [tlug] Setting Date Variable for Cron Job
- From: Charles Muller
- References:
- [tlug] Setting Date Variable for Cron Job
- From: Charles Muller
Home | Main Index | Thread Index
- Prev by Date: [tlug] Setting Date Variable for Cron Job
- Next by Date: Re: [tlug] Setting Date Variable for Cron Job
- Previous by thread: [tlug] Setting Date Variable for Cron Job
- Next by thread: Re: [tlug] Setting Date Variable for Cron Job
- Index(es):
Home Page Mailing List Linux and Japan TLUG Members Links