I'm having some problem with a bash script. Actually what I want to do is compress different files with some mask that includes the date.
Here's my script
#korn
date=`date '+%Y%m%d'`
echo $date
path="tar -cf /cdr_files/cdr_backups/${date}_ADJT.tar"
echo $path
What I want as an output is: tar -cf /cdr_files/cdr_backups/20090916_ADJT.tar and I'm getting something different.
Here's the output that I'm getting excecuting the bash -x
++ date +%Y%m%d
+ date=$'20090916\r'
+ echo $'20090916\r\r'
20090916
'ADJT.tarar -cf /cdr_files/cdr_backups/20090916
+ echo tar -cf $'/cdr_files/cdr_backups/20090916\r_ADJT.tar\r\r'
_ADJT.tarcdr_files/cdr_backups/20090916
Are the \r the problems? How can I remove them?
Thanks in advanced