variables can't read home directory
I am trying to run a scrip that has variables like
$STORDIR $TEMPDIR $WORKDIR when I try to do Code:
user:~/BDay$ $STORDIR="$HOME/BDay" Well it is there and I am working out of that directory. The permissions on the files are correct. I do use Debian Testing, currently called Jessie Any ideas? Thanks |
Read the error again. It is not saying that you have no /home/user/BDay, it is saying you have no =/home/user/BDay.
|
well I thought that $STORDIR=/$HOME/BDay was how you set a variable from the command line. Is that not right? Nope.
STORDIR=/$HOME/BDay would be correct. Now it works. Still does not explain why the script running as the local user can not write the output file to the local users directory. |
It should be
STORDIR=$HOME/BDay Quote:
|
The script is at
https://github.com/rbees/Birthday-Blessings the permissions are 644 or 755 depending on the file/folder all are owned by the local user the script runs fine on a different machine so the issue is with my laptop the scripts were written by a well experienced guy |
So is there still an issue? If so, what is it and what errors are you receiving?
|
Thanksn
None, and that is just it. The other day we tried to debug over the phone but only discovered that for some reason my system will not write the output file to $STORDIR I tried to run it in one of my vms but they all seam to have some kind of an issue themselves so that the shared folder is not accessible. Guess I will have to install a new one. I have tried putting echo statements in to see if I could figure out where it is failing, but no joy. |
I can confirm that what ever the issue is, it is specific to my laptop. I set up a Debian Testing (Jessie/current) VBox Vm, same as my laptop and did the setup and the scripts run fine.
If you had some idea I would be glad to investigate, but my time to play is very limited. Thanks. |
First lose the idea that $STORDIR is a variable. It isn't. What it directs the shell to do is replace the string "$STORDIR" with the value of the "STOREDIR" variable.
Second, on the face of it, the STOREDIR is local variable - that means that processes will NOT get it. To have it exported to processes you have to export it "export STOREDIR". You can even say "export STOREDIR=..." to get it assigned and exported at once. |
All times are GMT -5. The time now is 06:59 PM. |