Skip to content
This repository has been archived by the owner on Apr 24, 2021. It is now read-only.

always try to find $HOME of 'user' #7

Open
eins78 opened this issue May 7, 2013 · 3 comments
Open

always try to find $HOME of 'user' #7

eins78 opened this issue May 7, 2013 · 3 comments
Labels

Comments

@eins78
Copy link
Contributor

eins78 commented May 7, 2013

  • right now setting a 'user' different from the user running the cli is possible, but without effect (base is always in $USERs $HOME/wirt
  • to do it right, i have to find the $HOME by $USER
  • just path.join('/home', $USER) is not enough, so:

How to find a Users home directory by id on POSIX?

Solution does not have to be node-specific, any shell script will do

@eins78
Copy link
Contributor Author

eins78 commented May 7, 2013

Idea 1:

su $USER -c 'echo $HOME'

ORLY???

@storchi
Copy link

storchi commented May 7, 2013

Am 07.05.2013 16:27, schrieb Max Albrecht:

Idea 1:

su $USER -c 'echo $HOME'

ORLY???


Reply to this email directly or view it on GitHub:
#7 (comment)

cat /etc/passwd | grep $USER

@eins78
Copy link
Contributor Author

eins78 commented May 7, 2013

sowas habe ich auch schon gefunden. ist aber ein halber hack. geht auch auf OSX eh nicht.

ist zwar für den wirt fast egal, aber ich würde bei der gelegenheit gern einen kurzen befehl haben der in jedem POSIX funzt.

das snippet oben geht ja auch nur wenn der user eine shell hat, aber das reicht schon fast.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants