Variable issue

2008-10-14 Thread Brian
Hi I'm testing some of my PERL on a system running server 2003 and have immediately hit upon a problem, I have the following lines in a batch file, for /F "tokens=4 delims=/ " %%y in ('echo %date%') do set year=%%y for /F "tokens=3 delims=/ " %%m in ('echo %date%') do set month=%%m Whilst these

Re: variable issue

2004-02-24 Thread WC -Sx- Jones
my $time = system("/bin/date +%H | awk -F '{if ($1 == 00) print 23; else if ($1 <= 10) print 0$1 -1; else print $1 -1}'"); And to stop making an expensive system call for such a trivial task =) -Sx- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <

Re: variable issue

2004-02-24 Thread Randy W. Sims
On 02/24/04 14:18, Randy W. Sims wrote: On 02/24/04 13:49, rmck wrote: Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. I can run that awk statement on the command line and it works great, but if I try it in the script it

Re: variable issue

2004-02-24 Thread Randy W. Sims
On 02/24/04 13:49, rmck wrote: Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. I can run that awk statement on the command line and it works great, but if I try it in the script it fails with an awk syntax error... Is t

Re: variable issue

2004-02-24 Thread Paul Johnson
On Tue, Feb 24, 2004 at 10:49:50AM -0800, rmck wrote: > I need this variable $time to show last hour (00..23) So if hour is > 00, I want 23. If hour is 01, I want 00, etc. > > I can run that awk statement on the command line and it works great, > but if I try it in the script it fails with a

Re: variable issue

2004-02-24 Thread WC -Sx- Jones
rmck wrote: Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. I can run that awk statement on the command line and it works great, but if I try it in the script it fails with an awk syntax error... Is there a way to look

Re: variable issue

2004-02-24 Thread Kenton Brede
On Tue, Feb 24, 2004 at 10:49:50AM -0800, rmck ([EMAIL PROTECTED]) wrote: > Help > > I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. > If hour is 01, I want 00, etc. > Take a look at the "localtime" function. $ perldoc -f localtime hth, kent -- "Effic

variable issue

2004-02-24 Thread rmck
Help I need this variable $time to show last hour (00..23) So if hour is 00, I want 23. If hour is 01, I want 00, etc. I can run that awk statement on the command line and it works great, but if I try it in the script it fails with an awk syntax error... Is there a way to look at last ho