Link to home
Start Free TrialLog in
Avatar of Stephen Slaven
Stephen Slaven

asked on

Rename a dest file

I am compressing files into one zip file and I am using the WSFTP script Editor/debugger and I want to rename the dest file to abc-yyyymmdd.zip. I am using the RENAME command as FirstFileName.txt abc-[YYYY][MM][DD].zip and that is what I get in the dest folder. I need the current date to be inserted.
Avatar of huacat
huacat

filename=$(date +abc-%Y%m%d.zip)
echo $filename
Avatar of Stephen Slaven

ASKER

In the Script I Changed the RNAME command to RENAME myfil.txt ABC%Y%m%d.zip and I get Failure in command RENAME
Hi Stephen,

Please check my demo becareful.

it call date command to get current date with speicified formatting.
You can't use %Y%m%d directly, it just a date formatting parameters.
@Stephen Slaven
Forced accept if inactive more than 14 days.
This question needs an answer!
Become an EE member today
7 DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform.
View membership options
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.