LinuxQuestions.org
Help answer threads with 0 replies.
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 08-24-2014, 09:16 PM   #1
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 871

Rep: Reputation: 43
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"
bash: =/home/user/BDay: No such file or directory
user:~/BDay$ pwd
/home/user/BDay
to manually set the variable to see what happens but I get the above error about no such file....

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
 
Old 08-24-2014, 09:52 PM   #2
smallpond
Senior Member
 
Registered: Feb 2011
Location: Massachusetts, USA
Distribution: CentOS 6 (pre-systemd)
Posts: 2,609

Rep: Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702Reputation: 702
Read the error again. It is not saying that you have no /home/user/BDay, it is saying you have no =/home/user/BDay.
 
Old 08-24-2014, 10:11 PM   #3
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 871

Original Poster
Rep: Reputation: 43
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.
 
Old 08-24-2014, 11:50 PM   #4
pwalden
Member
 
Registered: Jun 2003
Location: Washington
Distribution: Fedora FC23, Raspbian, Ubuntu Precise via Chrome/Crouton
Posts: 350

Rep: Reputation: 41
It should be

STORDIR=$HOME/BDay

Quote:
Still does not explain why the script running as the local user can not write the output file to the local users directory.
You never shared your script or your file and directory permissions.
 
Old 08-25-2014, 05:37 AM   #5
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 871

Original Poster
Rep: Reputation: 43
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
 
Old 08-25-2014, 10:01 AM   #6
grail
LQ Guru
 
Registered: Sep 2009
Location: Perth
Distribution: Manjaro
Posts: 9,250

Rep: Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684Reputation: 2684
So is there still an issue? If so, what is it and what errors are you receiving?
 
Old 08-25-2014, 01:29 PM   #7
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 871

Original Poster
Rep: Reputation: 43
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.
 
Old 08-26-2014, 05:42 AM   #8
rbees
Member
 
Registered: Mar 2004
Location: northern michigan usa
Distribution: Debian Squeeze, Whezzy, Jessie
Posts: 871

Original Poster
Rep: Reputation: 43
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.
 
Old 08-26-2014, 07:10 AM   #9
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,602

Rep: Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241Reputation: 1241
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.
 
  


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
A Home Server With Media Files in Home Directory vs. /var/www/music slurt Linux - Server 2 05-11-2014 12:06 PM
"Home directory already exists. Please enter another home directory path." Daravon Ubuntu 2 02-15-2009 11:26 PM
contents of 'home' directory found at sda5: mounted as /home, and also on sda6:/home leswatson Linux - Newbie 4 04-18-2008 05:02 PM
Why has my /home directory gone read-only!? esme_squalor Linux - General 8 02-17-2006 10:59 AM
Non-root users can log in to SSH but not read Home Directory? Bizanshee Linux - Software 1 09-18-2002 08:01 PM


All times are GMT -5. The time now is 06:50 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