Monday, January 31, 2011

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

-bash: ./2_genDB.sh: /bin/bash^M: bad interpreter: No such file or directory

Here is the solution:
http://www.linuxforums.org/forum/red-hat-fedora-linux/65469-bad-interpreter-no-such-file-directory.html

Quote:
#!/usr/bin/perl

die "Usage: $0 < files >\n" unless @ARGV;

for $file (@ARGV)
{
open IN, $file or die "$0: Cannot open $file for input!\n";

my @lines = <IN>;

close IN;
open OUT, "> $file" or die "$0: Cannot open $file for output!\n";

s/\r$// for @lines;
print OUT for @lines;
}

Save this file as fix_m.pl

run perl fix_m.pl yourshell.sh

No comments:

Post a Comment