Hello. I linked two servers together, to transfer files via .sh script.
Created a test.sh file with content:
scp -P 22 /file/my_file.conf root@IP_SERVER:/folder/file.txt If you run this file through the Shell client with the command: sh /folder/test.sh file is transferred to the server, but you cannot open this file, it is broken.
And if you just run the command in the Shell client: scp -P 22 /file/my_file.conf root@IP_SERVER:/folder/file.txt - the file is transferred and as it should be, not broken.
What can be wrong?