Showing posts with label bash. Show all posts
Showing posts with label bash. Show all posts

Saturday, May 12, 2012

Solving "/bin/bash^M: bad interpreter: No such file or directory"

If you are getting errors like "/bin/bash^M: bad interpreter: No such file or directory", then I am a mind-reader and can say that you have edited this script on a Windows system. Error looks like:
# ./mysql_backup.sh
-bash: ./mysql_backup.sh: /bin/bash^M: bad interpreter: No such file or directory
You can solve this error by using "dos2unix" as:
# dos2unix mysql_backup.sh

Tuesday, October 11, 2011

Changing User Login Shell On Linux


There are many kinds of shells available.I prefer bash shell which is default on Debian Systems.
To see available shells,do:
cat /etc/shells
To change the shell for a user,we have to edit /etc/passwd file and replace the line /bin/shellname to  your preferred shell.
For example, replace /bin/sh to /bin/bash for user to which it is being done.