Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

calling outside script into perl mv()

Status
Not open for further replies.

grazinggoat

Programmer
Mar 12, 2008
41
US
Hello Gents!

I'm trying to move gz files to gz files adding a timestamp at the end of the file using an already written ksh script

the ksh script is called fstamp

here is what i'm doing :

move( $File.gz $File.`$BIN/fstamp`.gz );

However I am getting the following syntax error:

Can't call method "gz" without a package or object reference at ./etvarlogmv line 31.

Any thoughts how i can get around this error?

I've written (and it works) the line using system()

system (" /BIN/mv $File.gz $File.`$BIN/fstamp`.gz ");

but was hoping i'd be able to use perl to move the file vs calling out to system.

Thnx


 
SOLVED my issue:

used strftime

move( $File.gz $File.(strftime '%Y%m%d%H%M%S%Z', localtime time).gz )

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top