Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

^M line ends in migrate2rocky.sh results in error " /bin/bash^M: bad interpreter: No such file or directory" #165

Open
anowak-ct opened this issue Mar 3, 2022 · 3 comments

Comments

@anowak-ct
Copy link

Reproduce:

  1. git clone https://github.com/rocky-linux/rocky-tools.git
  2. cd rocky-tools/migrate2rocky
  3. chmod 775 migrate2rocky.sh
  4. sudo su
  5. ./migrate2rocky.sh -h
    Result:
    bash: ./migrate2rocky.sh: /bin/bash^M: bad interpreter: No such file or directory

Tested with git commit f3fe6d7

Obviously, migrate2rocky.sh contains some DOS line endings...

@anowak-ct
Copy link
Author

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

@pajamian
Copy link
Collaborator

I am unable to reproduce this issue. What output (if any) do you get from this command:
git config --global --get core.autocrlf

@tjyang
Copy link

tjyang commented Dec 23, 2022

  • 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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants