LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 09-04-2002, 05:16 PM   #1
Stefangeelen
LQ Newbie
 
Registered: Sep 2002
Distribution: Suse 8.0
Posts: 5

Rep: Reputation: 0
Angry bash: ./myscript: bad interpreter: No such file or directory


Hi, I get following error message when trying to execute a simple script :

stefan@linux:~/XMLMillZip131> ./myscript

bash: ./myscript: bad interpreter: No such file or directory

The script itself is:

-rwxr-xr-x 1 stefan users 56 Sep 4 23:56 myscript

and the content is:

#!bin/bash
echo "This is your dir:"
ls $HOME
echo "Done"

I checked the bin directory and the bash program exists:

-rwxr-xr-x 1 root root 457528 Mar 23 19:56 bash

I browsed this forum but appareantly my problem can't be solved (I already copied the script to a Linux partition on my HD, thought that was the problem).

I get the same error when I am logged in as root.

If I type in:

stefan@linux:~/XMLMillZip131> bash myscript

then it works !

Please advice !
 
Old 09-04-2002, 05:34 PM   #2
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Shouldn't you have a / in front of bin/bash ?? Or is that just a typo ? Let us know !
 
Old 09-05-2002, 01:42 AM   #3
Stefangeelen
LQ Newbie
 
Registered: Sep 2002
Distribution: Suse 8.0
Posts: 5

Original Poster
Rep: Reputation: 0
Smile Solved !

Hi,

thx, how stupid of me not to see this.

OK, to summarize:

1. I changed to /bin/bash and now it works fine.
2. I copied the script back to my FAT32 partitions and .... it doesn't work there ! ?

Appareantly it is not a good idea to start executing scripts on a FAT32 partition, it is just good enough to shuffle files between my Windows and Linux OS.

Thx again for your support.

Stefan
 
Old 09-05-2002, 01:50 AM   #4
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,414

Rep: Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966Reputation: 1966
it won't work there in that form as the file needs to have an executable bit set, which is not possible under fat32. you can always run it via "bash ./filename" instead though
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
bad interpreter: No such file or directory EcLip$e Linux - General 34 10-07-2013 03:11 AM
: bad interpreter: No such file or directory ciberrust Linux - Networking 10 09-09-2010 06:51 AM
Bash: bad interpreter, permission denied jpantone Linux - General 22 05-27-2010 06:05 AM
: bad interpreter: No such file or directory lnx8 Linux - General 4 04-29-2004 02:56 AM
bash: ./fam_mirror: bad interpreter: No such file or directory linuxboy69 Linux - Software 5 12-22-2003 11:35 AM


All times are GMT -5. The time now is 06:26 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration