|
||||||
| Forums FAQ | Members List | Search | Today's Posts | Mark Forums Read |
| ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc |
|
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
I have an environment variable exported from .bashrc that is a directory, let's call this variable DIRECTORY.
When in a console I enter: ls $DIRECTORY I get the correct ls results, but when I execute this command from inside of a bash script I get a "No such file or directory" error. Any advice will be appreciated as I am very frustrated. I am running SUSE 10.2 64-bit on a dual opteron workstation. To add insult to injury, the directory in question is an NFS share and the non-local machines can access the directory just fine from within bash scripts, only the local node cannot seem to see it's own local directory. Thanks! |
|
|||
|
Where is your bash script executed from? A cron job?
What do you get when you put a line: echo $DIRECTORY before the ls? |
|
|||
|
Quote:
For both console and script, echo $DIRECTORY gives the expected result, but only console gives the correct result for ls $DIRECTORY. |
|
|||
|
Do you get the same error when you say inside the script
/usr/bin/ls $DIRECTORY ? |
|
|||
|
It's in /bin/ls actually.
OP, exactly what is not found? The ls command or the directory? |
|
|||
|
Quote:
I even made a new directory on the same [nfs shared] directory and had the same results. I have not yet tried to do ls / from a script to determine if it is just an issue with the partition that the nfs share is on. Other networked machines can see the nfs share without issue even from shell scripts - only the machine that the nfs share is local to can't find it from scripts. |
|
|||
|
Ok, I tried
ls / to rule out some nfs quirk and get the same response (from console I can see everything, from script I get "No such file or directory").. I have other network computers using the nfs share right now so I can't reboot. Hmm... I can't even log off and then back on since I started the job by ssh. |
|
|||
|
Is this machine running some sort of selinux or apparmor environment?
|
|
|||
|
Quote:
|
|
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|