Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Wed 23 Jul 2014, 02:01
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
/root or $HOME? [SOLVED]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [8 Posts]  
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1803
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Tue 02 Apr 2013, 06:43    Post subject:  /root or $HOME? [SOLVED]  

Hello,
/root or $HOME?
Inside a script, are these to paths equivalent or different, for example, has this any importance according to the mode Puppy is running?
Thank you for your attention.

Cordialement.

Last edited by Argolance on Tue 02 Apr 2013, 14:27; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
L18L

Joined: 19 Jun 2010
Posts: 2500
Location: Burghaslach, Germany somewhere also known as "Hosla"

PostPosted: Tue 02 Apr 2013, 09:15    Post subject: Re: /root or $HOME?
Subject description: $HOME !
 

Argolance wrote:
equivalent or different

equivalent if running as root

different if not running as root (---> fido, spot, rex or any other name)
fido's HOME is /root/fido
spot's HOME is /root/spot

I would recommend always $HOME
Back to top
View user's profile Send private message 
musher0


Joined: 04 Jan 2009
Posts: 4226
Location: Gatineau (Qc), Canada

PostPosted: Tue 02 Apr 2013, 09:40    Post subject:  

Salut Argolance.

In addition to L18L's observations, if, in a console, you type :
    Code:
    rox /mnt/home
    you get the directory where your Puppy system files are located;
    Code:
    rox $HOME
    you get the usual "/root";
    Code:
    rox $home
    you get a listing of the directory from which you issued your command.

I hope this helps.

Bye for now.

musher0

_________________
"Logical entities must not be multiplied needlessly." / "Il ne faut pas multiplier les êtres logiques inutilement." (Ockham)

Last edited by musher0 on Tue 02 Apr 2013, 15:07; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
darkcity


Joined: 23 May 2010
Posts: 2424
Location: near here

PostPosted: Tue 02 Apr 2013, 10:18    Post subject:  

Can't you use
~/
to point the current 'root/home' directory.

Which means it will work on a Linux that is using non-root login. So maybe ~/ = $HOME ?

_________________
helping Wiki for help | IF SendSpace link = "dead" THEN PM me ("up file to http://meownplanet.net/")
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2217

PostPosted: Tue 02 Apr 2013, 11:26    Post subject:  

'~/' and '$HOME' are equivalent and should always be used instead of any hard-coded path to the users home dir.
Back to top
View user's profile Send private message 
Argolance


Joined: 06 Jan 2008
Posts: 1803
Location: PORT-BRILLET (Mayenne - France)

PostPosted: Tue 02 Apr 2013, 14:27    Post subject:  

Hello,
Thank you to all of you, "mates"! Wink

Cordialement.
Back to top
View user's profile Send private message Visit poster's website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3953
Location: Kiel,Germany

PostPosted: Wed 03 Apr 2013, 00:33    Post subject:  

Am launching xwin via /etc/inittab :
Code:
bash-3.2# echo $HOME
/


It appears that rox uses "$HOME" as well.

Some probably should be /root though :

/root/.packages
/root/.pup_event
Back to top
View user's profile Send private message Visit poster's website 
amigo

Joined: 02 Apr 2007
Posts: 2217

PostPosted: Wed 03 Apr 2013, 04:44    Post subject:  

At the time that inittab is used, *no* user is logged in. Everything is run effectively as root during init, but root is not logged in. It's called Single User Mode. That's why $HOME evaluates to '/' -the default.
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [8 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0581s ][ Queries: 11 (0.0056s) ][ GZIP on ]