![]() |
cp: target \r' is not a directory --- URGENT thanks
Hello All,
I am running following commands and ist runs fine for me. cp -r /mnt/datasource/* /opt/IBM/WebSphere/DataSource/ But if I put this command in script, it does not work. vi cpydata cp -r /mnt/datasource/* /opt/IBM/WebSphere/DataSource/ #save it > chmod 777 cpydata > ./cpydata > cp: target `/opt/IBM/WebSphere/DataSource/\r' is not a directory ??? |
Quote:
|
OS:zLinux, SuSE Linux Enterprise Server
echo $SHELL /bin/bash I have run in the morning and its work fine. |
"\r" is carriage return and may have arisen from creating the script using a Windows text editor. In Windows each line ends with "carriage return" and newline. In Linux each line ends with newline alone so any preceding carriage return is taken as part of the line.
The fromdos command can be used to convert Windows/DOS format files. For a quick-and-dirty solution you can comment out the end of line Code:
cp -r /mnt/datasource/* /opt/IBM/WebSphere/DataSource/ # comment to hide end of line garbage |
Quote:
On one stage I move file to window PC through winscp tool. I put back and its become corrupted. I wrote another script with same code and its work. Thanks |
Quote:
Catkin, thanks for the subtle point! |
| All times are GMT -5. The time now is 11:16 AM. |