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 Mon 22 Dec 2014, 05:28
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 Posts_count  
Author Message
Argolance


Joined: 06 Jan 2008
Posts: 1851
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.

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
L18L

Joined: 19 Jun 2010
Posts: 2620
Location: www.eussenheim.de/

PostPosted: Tue 02 Apr 2013, 09:15    Post_subject: Re: /root or $HOME?
Sub_title: $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: 4465
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)

Edited_time_total
Back to top
View user's profile Send_private_message Visit_website 
darkcity


Joined: 23 May 2010
Posts: 2481
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_website 
amigo

Joined: 02 Apr 2007
Posts: 2294

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: 1851
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_website 
Karl Godt


Joined: 20 Jun 2010
Posts: 3982
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_website 
amigo

Joined: 02 Apr 2007
Posts: 2294

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:   Sort by:   
Page 1 of 1 Posts_count  
Post_new_topic   Reply_to_topic View_previous_topic :: View_next_topic
 Forum index » Off-Topic Area » Programming
Jump to:  

Rules_post_cannot
Rules_reply_cannot
Rules_edit_cannot
Rules_delete_cannot
Rules_vote_cannot
You cannot attach files in this forum
You can download files in this forum


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