LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
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 07-19-2005, 03:02 PM   #1
Pestossimo
LQ Newbie
 
Registered: Jul 2005
Location: Evanston, IL
Posts: 7

Rep: Reputation: 0
scripting woes - invoking scripts


Here's the background. I have a full install of Slackware 10 on one partition, and am using it to build a Linux From Scratch system on another partition. I'm using the how-to from the Linux Documentation Project.

I'm trying to compile bash, and am having trouble getting the configure script to run. Here's what I get when I try to run configure:

/mnt/lfs/usr/src/bash-3.0$ ./configure
-bash: ./configure: /bin/sh: bad interpreter: permission denied

Here's why I'm so befuddled:

* configure is flagged as an executable
* the script starts with #!/bin/sh
* /bin/sh is a symlink to /bin/bash
* all the permissions are correct for sh, bash and configure

I've written my own little test scripts and run them from the same directory without any problem. I can get configure to run by using 'source' or '.' but get other errors, which I will tackle later.

Why do some scripts seem to insist that I use 'source' or '.', and others run just fine?

Last edited by Pestossimo; 07-19-2005 at 03:16 PM.
 
Old 07-19-2005, 03:34 PM   #2
darkleaf
Senior Member
 
Registered: Jun 2004
Location: the Netherlands
Distribution: debian SID
Posts: 2,170

Rep: Reputation: 45
Are the permissions right? Try "chmod +x configure"
 
Old 07-19-2005, 06:48 PM   #3
Pestossimo
LQ Newbie
 
Registered: Jul 2005
Location: Evanston, IL
Posts: 7

Original Poster
Rep: Reputation: 0
Okay, I checked, and it's not the permissions. Maybe this will help


Script started on Tue 19 Jul 2005 05:11:01 PM UTC

lfs@darkstar:/mnt/lfs/usr/src/bash-3.0$ configure
bash: ./configure: /bin/sh: bad interpreter: Permission denied
lfs@darkstar:/mnt/lfs/usr/src/bash-3.0$ ls -l configure
-rwxr-xr-x 1 lfs users 687082 2005-07-19 10:39 configure
lfs@darkstar:/mnt/lfs/usr/src/bash-3.0$ . configure

checking build system type...
i686-pc-linux-gnu
checking host system type...
i686-pc-linux-gnu
checking for emacs...
emacs
checking where .elc files should go...
${datadir}/emacs/site-lisp

Beginning configuration for bash-3.0-release for i686-pc-linux-gnu
checking for gcc...
gcc -s
checking for C compiler default output...
a.out
checking whether the C compiler works...
bash: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details.

Script done on Tue 19 Jul 2005 05:12:07 PM UTC


At this point, because I am using 'source' it logs me out when the script exits
 
Old 07-20-2005, 01:43 PM   #4
Pestossimo
LQ Newbie
 
Registered: Jul 2005
Location: Evanston, IL
Posts: 7

Original Poster
Rep: Reputation: 0
I figured it out. The problem was that the script was sitting on another partition that I had mounted.

The how-to that I've been following said that I should compile everything as an unprivileged user. To do this I set the user option for that partition in /etc/fstab so I wouldn't have to su root to mount that partition. What I didn't realize was that the user option also sets the noexec option. So, even though the permissions for each file and directory were correct, I couldn't execute anything on that partition, be it a script or a compiled program.
 
  


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
Scripting help. welby Linux - General 1 07-22-2005 09:32 PM
scripting woes slack9.0 the_cranky_don Slackware 10 11-03-2004 05:56 AM
Scripting? eXor Linux - Newbie 3 06-15-2004 07:43 AM
scripting anjiie Linux - Newbie 1 02-16-2004 09:17 AM
scripting help versaulis Linux - Software 8 11-22-2003 08:08 PM


All times are GMT -5. The time now is 10:31 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration