sed command fails to edit when a sh file is executed using the custom command call.
Hi Martin,
I am automating the process of editing a properties file with sed command.
I am generating a sh file in windows environment based on the input received from the user through GUI and then form the sed command with the old value and the new value like below. The below command will be available in the 'File1.sh' file
sed -i '/old/c\newvalue' /path/path/filename.properties
Then I will put this file in the remote machine with the put command and then execute the shell file with the 'call filename.sh' command.
But when I run the code (ie call /root/upload/config/File1.bat ), file editing is not successful. I get 'No such file or directory' error.
If I open the .sh file via winscp.exe editor make some changes then save it. Then if I execute the bat file manually, it is succeeded.
Not sure how to fix this issue.
I am automating the process of editing a properties file with sed command.
I am generating a sh file in windows environment based on the input received from the user through GUI and then form the sed command with the old value and the new value like below. The below command will be available in the 'File1.sh' file
sed -i '/old/c\newvalue' /path/path/filename.properties
Then I will put this file in the remote machine with the put command and then execute the shell file with the 'call filename.sh' command.
But when I run the code (ie call /root/upload/config/File1.bat ), file editing is not successful. I get 'No such file or directory' error.
If I open the .sh file via winscp.exe editor make some changes then save it. Then if I execute the bat file manually, it is succeeded.
Not sure how to fix this issue.