On Fri, 2004-04-16 at 17:05, JJB wrote:
> I know nothing about writing perl scripts.
> 
> Can somebody show me how to  add the : in the output 
> of the date command in the simple following script?

Try this:

#!/usr/bin/perl
$timezone=`date +\%z`;                  #Gets the offset in $timezone
$timezone =~ s/(\+[0-9][0-9])/$1:/;     #Replaces ±NN with ±NN:
print $timezone;                        #Prints $timezone


-- 
Shaun Friedle
[EMAIL PROTECTED]

_______________________________________________
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to