W
wazzu62
I am a perl newbie and am trying to convert some shell scripts I have
written into perl as a learning excercise.
I have a bash script that has this line in it:
ksize=`du -sk /files/archive/$period/$day/*$site* | awk '{sum = sum +
$1} END {print sum}'`
If I imbed this in a perl script as such:
$ksize=`du -sk /files/archive/$dates[$cnt]/*$site* | awk '{sum = sum +
[$1]} END {print sum}'`;
It generates this error
awk: cmd. line:1: {sum = sum + []} END {print sum}
awk: cmd. line:1: ^ parse error
expr: syntax error
It seems to not like the $1 variable awk is using.
Anyone have any ideas how to get around this?
Thanks in advance.
wazzu
written into perl as a learning excercise.
I have a bash script that has this line in it:
ksize=`du -sk /files/archive/$period/$day/*$site* | awk '{sum = sum +
$1} END {print sum}'`
If I imbed this in a perl script as such:
$ksize=`du -sk /files/archive/$dates[$cnt]/*$site* | awk '{sum = sum +
[$1]} END {print sum}'`;
It generates this error
awk: cmd. line:1: {sum = sum + []} END {print sum}
awk: cmd. line:1: ^ parse error
expr: syntax error
It seems to not like the $1 variable awk is using.
Anyone have any ideas how to get around this?
Thanks in advance.
wazzu