rocky-tools
rocky-tools copied to clipboard
^M line ends in migrate2rocky.sh results in error " /bin/bash^M: bad interpreter: No such file or directory"
Reproduce:
-
git clone https://github.com/rocky-linux/rocky-tools.git
-
cd rocky-tools/migrate2rocky
-
chmod 775 migrate2rocky.sh
-
sudo su
-
./migrate2rocky.sh -h
Result:bash: ./migrate2rocky.sh: /bin/bash^M: bad interpreter: No such file or directory
Tested with git commit f3fe6d768a6f2f36bcb4a390e17a4f31eff2e499
Obviously, migrate2rocky.sh
contains some DOS line endings...
After converting migrate2rocky.sh
to unix line endings, the script works fine.
You can use the usual tools to convert line endings like dos2unix
or tr -d '\015' < dosfile > unixfile
I am unable to reproduce this issue. What output (if any) do you get from this command:
git config --global --get core.autocrlf
- Same here as @pajamian, please close this issue.
- Command I used to scan the .sh files for the verification.
find . -name "*.sh" | xargs file | grep "CRLF"