LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-30-2003, 05:24 AM   #1
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Rep: Reputation: 30
Exclamation #!/bin/sh


apparently something happened between yesterday and today to make sh a symlink to bash. I'm not sure if this is normal but I can't run configure scripts anymore...it simply says permission denied. sh, bash, and ./configure all have execution bits.

the only thing I have changed since yesterday is installing gaim...which I don't think would break anything.

any suggestions on what went wrong? I've tried doing sh ./configure but then the enviroment variables don't get passed to the script, causing it to fail.

Or, could someone link me to the bourne shell project page where I can download and compile it?
 
Old 04-30-2003, 05:45 AM   #2
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
/bin/sh is often a link /bin/bash. What are the permissions on /bin/bash? (ls -l /bin/bash)

cheers

Jamie...
 
Old 04-30-2003, 06:01 AM   #3
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
sohmc@zulu:~> ls -l /bin/sh
lrwxrwxrwx 1 root root 4 Apr 30 06:01 /bin/sh -> bash*
sohmc@zulu:~> ls -l /bin/bash
-rwxr-xr-x 1 root root 528k Apr 12 2002 /bin/bash*


another clue to the problem...I decided to try the scripts in sh and this is what I get:
sh-2.05a$ ./setup-gettext ---gettext-tool
sh: ./setup-gettext: /bin/sh: bad interpreter: Permission denied
 
Old 04-30-2003, 06:06 AM   #4
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Uhm... I take it you can execute /bin/bash and /bin/sh directly if you wish? If you can then copy and paste the top line of the seutp-gettext script

cheers

Jamie...
 
Old 04-30-2003, 06:11 AM   #5
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
let me clarify: I can run *some* configure scripts. In fact, I just ran gaim's, and gettexts without problems. the first line all say the same thing:

#!/bin/sh
#! /bin/sh

(I don't think the space matters, does it?)
 
Old 04-30-2003, 06:15 AM   #6
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Quote:
Originally posted by sohmc
#!/bin/sh
#! /bin/sh

(I don't think the space matters, does it?)
It sure does... Lose the space and it'll all work!

Jamie...
 
Old 04-30-2003, 06:18 AM   #7
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
the ironic thing is:

sohmc@zulu:~/src/gaim> head -1 /src/gaim/gaim-0.62/configure
#! /bin/sh
(works correctly, note the space)

sohmc@zulu:~/src/gaim> head -1 ./autogen.sh
#!/bin/sh
(does not work correctly)

adding a space does not work either.
 
Old 04-30-2003, 06:21 AM   #8
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Very weird! You sure there is no trailing space or special chars on the first line?

cheers

Jamie...
 
Old 04-30-2003, 06:24 AM   #9
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
according to vi, no.

it isn't just the gaim-cvs autoconf. sh doesn't work for irssi. same problem.

wierd....should I install a newer bash? mine is *slightly* old, as in two or three minor revisions off.
 
Old 04-30-2003, 09:25 PM   #10
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
what's odd now is that my sh scripts that I've written myself that have worked in the past no longer work...

something had to have happen in the past two days that has changed the behavior of sh...

the only thing I did was install gaim 0.62...hmmm
 
Old 04-30-2003, 09:31 PM   #11
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
even better! the same script described in the last post doesn't work in it's original directory but works in /tmp!
 
Old 04-30-2003, 09:36 PM   #12
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
alrighty...I've narrowed down the problem. I cannot execute #!/bin/sh scripts when the file is on my external drive!

any suggestions on clearing that up?
 
Old 04-30-2003, 09:44 PM   #13
Tinkster
Moderator
 
Registered: Apr 2002
Location: earth
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928Reputation: 928
What filesystem is it?
If you do an ls -l on it, who's the owner
of the stuff on the external drive? You or
root? :)

Cheers,
Tink
 
Old 05-01-2003, 03:45 AM   #14
jharris
Senior Member
 
Registered: May 2001
Location: Bristol, UK
Distribution: Slackware, Fedora, RHES
Posts: 2,243

Rep: Reputation: 47
Also whats the output from just running the mount command. It sounds like the file system might be mounted with the noexec option which basically irnores all the executable bits.

Damn good thinking Tinkster

cheers

Jamie...
 
Old 05-01-2003, 04:20 AM   #15
sohmc
Member
 
Registered: Aug 2002
Location: Alexandria
Distribution: ubuntu 12.04.2
Posts: 217

Original Poster
Rep: Reputation: 30
entry from /etc/fstab:
/dev/sde1 /ext_drv ext3 noauto,users,rw 0 0

changed to:
/dev/sde1 /ext_drv ext3 exec,noauto,rw 0 0

according to mount, the options user and users automatically include the noexec flag.

and all sh scripts work again!! yay!!

That was fun. thanks everyone for your advice and help.
 
  


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
sudo /usr/bin/chroot /home/chroot /bin/su - xxx| /bin/su: user xxx does not exist saavik Linux - General 3 07-04-2007 10:30 AM
Installing .bin-files, leave the file in /usr/local/bin/ ? lagu2653 Linux - Software 1 11-08-2005 08:30 PM
Is '/usr/bin/find' reliable if '/bin/ls' has been replaced? DigaMe Linux - Security 2 11-12-2004 10:42 PM
bin/bash:usr/bin/lpr NO SUCH FILE OR DIRECTORY Adibe_Hamm Linux - Newbie 3 10-14-2003 02:30 AM
Newbie needs help Installing j2sdk-1_4_2-nb_3_5_1-bin-linux.bin bendoku Linux - Newbie 5 10-11-2003 09:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:28 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration