How would I enter the following line in crontab?: echo `date _%y%m%d` ^^^ ^^^ those are back-tic's crontab emails me an error message: Subject: Cron <pat@wahoo> echo "date _ /bin/sh: -c: line 1: unexpected EOF while looking for matching ``' /bin/sh: -c: line 2: syntax error: unexpected end of file enclosing back-tic string in double/single quotes does not make any difference. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery
On Friday 25 February 2005 08:12, Patrick Shanahan wrote:
How would I enter the following line in crontab?: echo `date _%y%m%d` ^^^ ^^^ those are back-tic's
crontab emails me an error message: Subject: Cron <pat@wahoo> echo "date _ /bin/sh: -c: line 1: unexpected EOF while looking for matching ``' /bin/sh: -c: line 2: syntax error: unexpected end of file
enclosing back-tic string in double/single quotes does not make any difference.
I get invalid date when I try it out of crontab. What is the rest of the line of your crontab entry? -- Collector of vintage computers http://www.ncf.ca/~ba600 Machines to trade http://www.ncf.ca/~ba600/trade.html Open Source Weekend http://www.osw.ca
On Fri, Feb 25, 2005 at 04:49:08PM +0100, Leendert Meyer wrote:
On Friday 25 February 2005 14:12, Patrick Shanahan wrote:
How would I enter the following line in crontab?: echo `date _%y%m%d` ^^^ ^^^ those are back-tic's
Already tried the $() alternative?
echo $(date _%y%m%d)
I am not sure about underscore. This is what I am using in crontab: $(date +\%y\%m\%d) "%" has a special meaning in crontab, it marks a new line. To use % as it is, you have to escape it. -Kastus
* Kastus <NOSPAM@tprfct.net> [02-25-05 14:16]:
I am not sure about underscore. This is what I am using in crontab:
$(date +\%y\%m\%d)
"%" has a special meaning in crontab, it marks a new line. To use % as it is, you have to escape it.
And this is the correct answer although calling the function as an external file also works. The underscore was a mistake/mistype, should have been a plus sign (+). What is the *special* function of the per cent (%) sign in crontab, if I may ask? Thankyou, -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery
On Fri, 2005-02-25 at 15:08, Patrick Shanahan wrote:
* Kastus <NOSPAM@tprfct.net> [02-25-05 14:16]:
I am not sure about underscore. This is what I am using in crontab:
$(date +\%y\%m\%d)
"%" has a special meaning in crontab, it marks a new line. ^^^^^^^^^^^^^^^^^^^
To use % as it is, you have to escape it.
And this is the correct answer although calling the function as an external file also works. The underscore was a mistake/mistype, should have been a plus sign (+).
What is the *special* function of the per cent (%) sign in crontab, if I may ask?
-- Ken Schneider UNIX since 1989, linux since 1994, SuSE since 1998 * Only reply to the list please* "The day Microsoft makes something that doesn't suck is probably the day they start making vacuum cleaners." -Ernst Jan Plugge
* Ken Schneider <suse-list@bout-tyme.net> [02-25-05 15:18]:
On Fri, 2005-02-25 at 15:08, Patrick Shanahan wrote:
* Kastus <NOSPAM@tprfct.net> [02-25-05 14:16]:
"%" has a special meaning in crontab, it marks a new line. .... What is the *special* function of the per cent (%) sign in crontab, if I may ask?
Doh! One of my *better* moments... <sheepish grin>. -- Patrick Shanahan Registered Linux User #207535 http://wahoo.no-ip.org @ http://counter.li.org HOG # US1244711 Photo Album: http://wahoo.no-ip.org/gallery
The Friday 2005-02-25 at 17:27 -0500, Patrick Shanahan wrote:
* Kastus <NOSPAM@tprfct.net> [02-25-05 14:16]:
"%" has a special meaning in crontab, it marks a new line. .... What is the *special* function of the per cent (%) sign in crontab, if I may ask?
Doh! One of my *better* moments... <sheepish grin>.
I was about going to ask where was that documented, but then I found it in crontab(5), instead of crontab(1) :-) -- Cheers, Carlos Robinson
On Friday 25 February 2005 8:12 am, Patrick Shanahan wrote:
How would I enter the following line in crontab?: echo `date _%y%m%d` how about making a shell script that works, then call the shell script from cron ? -- Paul Cartwright Registered Linux user # 367800 X-Request-PGP: http://home.comcast.net/~p.cartwright/wsb/key.asc
participants (7)
-
Carlos E. R.
-
Kastus
-
Ken Schneider
-
Leendert Meyer
-
Mike
-
Patrick Shanahan
-
Paul Cartwright