[net.unix-wizards] Crontab problem on 4.2

yan@siemens.UUCP (04/05/86)

Crontab problem on 4.2

	I have the following entry in the crontable:

	5 23 * * * /usr/local/bin/dateV '+%m%d' > /usr/adm/yesterday

	"dateV" is the 4.2 "date" command taken from SystemV.
	I expected to see:
		MMDD (where: MM - month, DD - day) 
	in /usr/adm/yesterday, however, I get the following when I "cat"
	/usr/adm/yesterday:
		[ blank line ]
		m
		d

	Why ??
			Thanks in advance.

	===============================================================

	Yan Nabedrik
	Siemens RTL		{inhp4|astrovax|allegra|dshvax}!siemens!yan
	Princeton, NJ

jsdy@hadron.UUCP (Joseph S. D. Yao) (04/15/86)

In article <93600014@siemens.UUCP> yan@siemens.UUCP writes:
>	5 23 * * * /usr/local/bin/dateV '+%m%d' > /usr/adm/yesterday
>		[ blank line ]
>		m
>		d
>	Why ??

In some versions of cron (including yours, FLAMERS NOTE: this means
not including others), the '%' character gets mapped into a newline
character when the command line is run.  I do not remember off-hand
whether (a) this is escaped with a back-slash; (b) this is escaped
by doubling the '%'; (c) it cannot be escaped.  In the last case,
and perhaps in any case, you can put the "dateV '+%m%d'" line in a
shell command file and call  t h a t  from crontab.
-- 

	Joe Yao		hadron!jsdy@seismo.{CSS.GOV,ARPA,UUCP}