I have three files on the directory
dailytba=daily_tba_position.${Today}
dailypol=daily_pool_position.${Today}
let=LET.${Today}
When I do the following:
if [ "${dailytba}" = "daily_tba_position.${Today}" ]
then
sftp_file=DB.DAILY.DAILYTBA.${ACCTNMGRP}.${Today}.${TM}
sftp_ind=${sftp_file}.ARD.ind
sftp_ard=${sftp_file}.ARD
touch ${sftp_ard}
sftp_out=${sftp_file}.ARD.out
mv ${dailytba} ${sftp_out}
fi
if [ "${dailypol}" = "daily_pool_position.${Today}" ]
then
sftp_file=DB.DAILY.DAILYPOL.${ACCTNMGRP}.${Today}.${TM}
sftp_ind=${sftp_file}.ARD.ind
sftp_ard=${sftp_file}.ARD
touch ${sftp_ard}
sftp_out=${sftp_file}.ARD.out
mv ${dailypol} ${sftp_out}
fi
if [ "${let}" = "LET.${Today}" ]
then
sftp_file=DB.DAILY.LET.${ACCTNMGRP}.${Today}.${TM}
sftp_ind=${sftp_file}.ARD.ind
sftp_ard=${sftp_file}.ARD
touch ${sftp_ard}
sftp_out=${sftp_file}.ARD.out
mv ${let} ${sftp_out}
fi
I am getting a message:
mv: cannot rename daily_tba_position.20170309 to DB.DAILY.DAILYTBA.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory
daily_tba_position.20170309 not found
mv: cannot rename daily_pool_position.20170309 to DB.DAILY.DAILYPOL.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory
daily_tba_position.20170309 not found
mv: cannot rename LET.20170309 to DB.DAILY.LET.MBSSB_MBSSBGROUP.20170309.102439.ARD.out:
No such file or directory
at the same time in the same script the following is working good
if [ "${letday}" = "LET_daily_trans_${Today}.csv" ]
then
sftp_file=DB.DAILY.LETDAY.${ACCTNMGRP}.${Today}.${TM}
sftp_ind=${sftp_file}.ARD.ind
sftp_ard=${sftp_file}.ARD
touch ${sftp_ard}
sftp_out=${sftp_file}.ARD.out
mv ${letday} ${sftp_out}
fi
Could you please let me know why?
I am working on AIX and using Bourne shell
I definitely know that files are on the directory
Thanks for contribution