[Chicago-talk] printing a hash value that has shell code in i t.

Dooley, Michael Dooley.Michael at con-way.com
Fri Dec 5 16:27:19 CST 2003


you guys make it to easy!!!

the strftime works great because I already use (below) for something else so
I have all the variables I need.
my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) = localtime(time);



-----Original Message-----
From: chicago-talk-bounces at mail.pm.org
[mailto:chicago-talk-bounces at mail.pm.org] On Behalf Of Don Drake
Sent: Friday, December 05, 2003 2:56 PM
To: 'Chicago.pm chatter'
Subject: RE: [Chicago-talk] printing a hash value that has shell code in it.


Parse out `date +%(.*?)` and replace $1 with the output of
POSIX::strftime($1,...).

-Don

-----Original Message-----
From: chicago-talk-bounces at mail.pm.org
[mailto:chicago-talk-bounces at mail.pm.org]On Behalf Of Dooley, Michael
Sent: Friday, December 05, 2003 1:01 PM
To: Chicago.pm chatter
Subject: [Chicago-talk] printing a hash value that has shell code in it.


open (DFH_FILE, "/var/adm/scripts/dfh") or die "Can not read DFH file ($!)";
	foreach (<DFH_FILE>) {
		chomp;
		($dfhtype, $dfh) = split(/=/, $_);
		$dfhtype=lc("$dfhtype");
		$dfhhash{$dfhtype}=$dfh;
	}
close DFH_FILE;

foreach (values (%dfhhash)) {
print $_,"\n";
}
-----
what if each line in DFH_FILE look like this. Anyone have any ideas how I
can convert the date portion to a legitamit date.

Q107945="DFH1  CW_OMS         4165909998     `date
+%Y%m%d%H%M%S%Y%m%d%H%M%S` q107945     01"
Q166204="DFH|1|q166|q190|`date +%Y%m%d`|`date +%H%M%S`|`date
+%Y%m%d%H%M%S`|q166204i|0|1"
ACCESSDBTXT="DFH,1,q100,CW_TMS,`date +%Y%m%d`,`date +%H%M%S`,`date
+%Y%m%d%H%M%S`,q100204i,0,1"
OMSARFIN="DFH   1       CW_OMS  CW_FIN  `date +%Y%m%d`  `date +%H%M%S`
`date +%Y%m%d%H%M%S`    AR_OUT  0       1"
--------------
_______________________________________________
Chicago-talk mailing list
Chicago-talk at mail.pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk

_______________________________________________
Chicago-talk mailing list
Chicago-talk at mail.pm.org
http://mail.pm.org/mailman/listinfo/chicago-talk



More information about the Chicago-talk mailing list