MV command error
Hi all,
I'm trying to use the mv command in my shell. But when i execute the shell, /r gets appended to my directory and the file name(file name is input).tried using /$'\r'/ .but still face the same issue. Please help Thanks Shyam |
Hi and welcome to LQ!
Quote:
|
Below is the part of the shell
----------------------------- #Declaration of directory path LV_DATA_PATH="$NCBC_TOP/ncbc_swift" # NCBC_TOP is defined to the directory i need LV_PARAM_PART21=`echo $LV_PARAM_PART2|awk -F"\" \"" '{print $1}'` LV_PARAM_PART22=`echo $LV_PARAM_PART2|awk -F"\" \"" '{print $2}'` LV_PARAM_PART23=`echo $LV_PARAM_PART2|awk -F"\" \"" '{print $3}'` LV_FILE_NAME="${LV_PARAM_PART22/$'\r'/}" echo $LV_FILE_NAME echo $LV_DATA_PATH mv $LV_DATA_PATH"/"$LV_FILE_NAME $LV_DATA_PATH"/"swift_ready"/"$LV_FILE_NAME below is the output and error ----------------------------- o5300142.out /oracle/ebssit/a01/apps/apps_st/appl/ncbc/12.0.0/ncbc_swift mv: cannot stat `/oracle/ebssit/a01/apps/apps_st/appl/ncbc/12.0.0/ncbc_swift\r/o5300142.out\r': No such file or directory |
Well first off, this would appear to be a script and not working directly in the shell.
As for the error, which now makes more sense, you have created the file in windows and then run it in linux. Issue is that windows uses \r\n for line endings and hence any variable being set now has \r at the end of it. Try running dos2unix over the script first and see how you go. |
All times are GMT -5. The time now is 10:51 PM. |