LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
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 02-20-2004, 01:38 PM   #1
zuma
LQ Newbie
 
Registered: Dec 2003
Distribution: gentoo
Posts: 12

Rep: Reputation: 0
bash and symbolic link


This is probably an easy problem but i can't figure it out.
I put my /home/myhome directory on a different partition of my disk (called /gamma, which is mounted atomaticly) and linked it with a symbolic link into /home. (ln -s)

everything is fine so far, home behaves as if it was still on the root-partition.
but: i cannot execute shell-scripts from there anymore.
$ ./foo.sh
-bash: ./foo.sh: bin/bash: bad interpreter: Permission denied

i changed the owner of the symbolic link but with no success with the scripts.

besides i can runn scripts from /tmp which is on the root partition. somehow bash canīt access my home directory on the other partition via the symbolic link.

sorry about writing so much. if anyone has an idea, i would be quite happy.

cheerio

Last edited by zuma; 02-20-2004 at 01:45 PM.
 
Old 02-20-2004, 02:24 PM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974Reputation: 1974
assuming "-bash: ./foo.sh: bin/bash: bad interpreter: Permission denied" is a typo, then you need to check the execute permissions on the file, if not somethign seems to be up with your script, maybe you're using relative file paths for the shebang at the start? it does ask for bin/bash not /bin/bash...
 
Old 02-20-2004, 04:22 PM   #3
zuma
LQ Newbie
 
Registered: Dec 2003
Distribution: gentoo
Posts: 12

Original Poster
Rep: Reputation: 0
got a cue

ok, but the execute rights for the scripts are all right.

what gives me a cue is that i can actually run the scripts from my home with:
# bash ./foo.sh
but not with
# ./foo.sh which i can from any directory on the root partition.
somehow bash doesn't reach on my /gamma partition via the symbolic link??

how can i change this and be able to run scripts from home without explicitely calling the bash?

TIA
 
Old 02-20-2004, 04:51 PM   #4
synapse
Member
 
Registered: Jan 2004
Location: On Planet Earth.
Distribution: Slackware 12
Posts: 244

Rep: Reputation: 30
Hi
what is the output from your path command?

cheers
 
Old 02-21-2004, 06:34 AM   #5
zuma
LQ Newbie
 
Registered: Dec 2003
Distribution: gentoo
Posts: 12

Original Poster
Rep: Reputation: 0
path command?

i am awfully sorry but i don't know which output of a path command you mean?

hasta la proxima
 
Old 02-21-2004, 07:44 AM   #6
DrOzz
Senior Member
 
Registered: May 2003
Location: Sydney, Nova Scotia, Canada
Distribution: slackware
Posts: 4,185

Rep: Reputation: 59
type :
$PATH
some people insist you type :
echo $PATH

either way, you will end up with your answer ;-)
 
Old 02-21-2004, 07:50 AM   #7
zuma
LQ Newbie
 
Registered: Dec 2003
Distribution: gentoo
Posts: 12

Original Poster
Rep: Reputation: 0
2 differnet answers

well yes, now i have two versions:

echo $PATH
/bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/
gcc-bin/3.2:/opt/Acrobat5:/usr/X11R6/bin:/opt/blackdown-
jdk-1.4.1/bin:/opt/blackdown-jdk-1.4.1/jre/bin:/usr/qt/3/bin:/
usr/kde/3.1/bin

$PATH
-bash: /bin:/usr/bin:/usr/local/bin:/opt/bin:/usr/i686-pc-linux-gnu/
gcc-bin/3.2:/opt/Acrobat5:/usr/X11R6/bin:/opt/blackdown-jdk-1.4.
1/bin:/opt/blackdown-jdk-1.4.1/jre/bin:/usr/qt/3/bin:/usr/kde/3.1/bin:
No such file or directory

and now?
 
Old 01-03-2005, 05:18 PM   #8
Marcelo Muņoz
LQ Newbie
 
Registered: Jan 2005
Location: Santiago, Chile
Distribution: suse, novell, redhat
Posts: 1

Rep: Reputation: 0
Lightbulb sh: bad interpreter: Permission denied

I have the same problem, it was a "noexec" option
over the partition where the script exists.

I changed the /etc/fstab file and remount the partition
with the right option, like "mount -o remount,exec /partition"
fix the problem.

mmunoz@ademn.cl
 
  


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
What is a Symbolic Link? little_penguin Linux - Software 2 05-14-2005 10:27 AM
symbolic link ilnli Slackware 6 01-04-2005 06:05 PM
help with a symbolic link mykrob Linux - Software 6 11-22-2004 11:01 AM
Symbolic link. bulzbb Linux - General 8 03-19-2004 05:57 AM
Symbolic link bwaynej2002 Linux - General 8 08-25-2003 11:06 PM


All times are GMT -5. The time now is 12:35 PM.

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