If you have problem when execute bash script, it’s caused by Windows environment and then porting over to run on a Unix environment.
If you use Notepad++, go to Edit and EOL Conversion and choose UNIX/OSX Format.
If you use Sublime text, open menu View, Line Endings and choose Unix.
Or you can running dos2unix on the script:
http://dos2unix.sourceforge.net/
Or just edit the script in your Unix environment using vi
and test, but sometimes can’t work, for exampe if you use Putty to connect Unix environment.
Unix uses different line endings so can’t read the file you created on Windows. Hence it is seeing ^M as an illegal character.
If you want to write a file on Windows and then port over, make sure your editor is set to create files in UNIX format.
Below is simple bash script to make it works:
# sed -i -e 's/\r$//' script.sh
If you found error thread.error: can't start new thread on yum update command on CentOS…
Cockpit is a web-based graphical interface for servers, intended for everyone, especially those who are:…
From cockpit-project.org, Cockpit is a web-based graphical interface for servers, intended for everyone, especially those…
We have been using Nginx with HTTP3 for more than 1 year on our production…
On CentOS 7, to sync date time we often use NTPD. But on CentOS 9,…
Remi repository is one of third-party repository that have latest update of PHP on Enterprise…