LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   /bin/.: Permission denied (https://www.linuxquestions.org/questions/programming-9/bin-permission-denied-31784/)

aizkorri 10-03-2002 05:56 AM

/bin/.: Permission denied
 
Hi I'm trying to execute a script as user int the current shell and when I do the following

. ./etc/profile.d/myconfigure.sh

I get this output

/bin/.: Permission denied

Even if I do "chmod 777 /bin/." as superuser it keeps telling me that I cannot execute the script as I want to.
Do you know how can I change the permissions for that?
thnx.
Aizkorri.

Hko 10-03-2002 06:25 AM

Quote:

Hi I'm trying to execute a script as user int the current shell and when I do the following

. ./etc/profile.d/myconfigure.sh
Try without the second dot:

. /etc/profile.d/myconfigure.sh

Hope this helps.

aizkorri 10-03-2002 06:41 AM

It returns the same permission problem. help!

sandy 10-03-2002 06:50 AM

Quote:

Originally posted by aizkorri
It returns the same permission problem. help!
Will you please post the shell script if it is not too longer?:rolleyes:

aizkorri 10-03-2002 08:48 AM

It's very simple:

PATH="$PATH:/usr/bin/"
DATA_FILE=/usr/lib/DATA_FILE
export DATA_FILE PATH

Hko 10-03-2002 02:49 PM

Are you logged in as a regular user? Then, do you have the correct rights to access /etc/profile.d/myconfigure.sh and access the directory it is in ? (/etc/profile.d) ?

I copied/pasted your script to my home-dir and there's no problem if I do:

cd ~
. ./myconfigure.sh

...so it has probably to do with your rights as a regular user to the directory or the file.

Agur,

Hko

sandy 10-04-2002 03:41 AM

I think the problem is in the third line. Just check for the permissions of the shells /bin/bash and /bin/sh since export is a command in the bash and sh shell:D

aizkorri 10-04-2002 08:10 AM

thnx, I will check the permissions of the file and shells.
agur.

cole42 03-17-2010 01:17 PM

type;
env | grep SHELL

running csh or bash? if it's csh that's your problem.

hit this one myself today, my user is using csh when I thought it was bash...

Sergei Steshenko 03-17-2010 01:33 PM

Quote:

Originally Posted by aizkorri (Post 150165)
It's very simple:

PATH="$PATH:/usr/bin/"
DATA_FILE=/usr/lib/DATA_FILE
export DATA_FILE PATH

Does the script have

Code:

#!/bin/sh
as its very first line ?


All times are GMT -5. The time now is 04:24 PM.