Thanks Raul, and Bob. Both work fine inside my app: 2!:0 'echo ~' 2!:5 'HOME'
On Thu, Apr 4, 2013 at 8:30 PM, Raul Miller <[email protected]> wrote: > ~user is the unix shell convention for referring to the home directory > of the user named 'user'. > > ~ by itself (or followed by a slash) is unix shell convention for > referring to the current user's home directory. > > Note however that these only work in contexts where shell wildcards > are interpreted -- you could run a subshell from J if you wanted that: > > 2!:0 'echo ~' > > Another convention for referring to the current user's home directory > is to refer to the environmental variable named HOME > > 2!:5 'HOME' > > Of course, both of these would fail on windows. > > FYI, > > -- > Raul > > > On Thu, Apr 4, 2013 at 3:12 PM, Ian Clark <[email protected]> wrote: > > The pith's going soft here... > > > > How do I find the logged-on user's home directory on the Mac? > > (I'm still using j602 for this.) > > > > Hitherto I've been using: jpath '~user' > > ...but if I create a MacOS app, with its own embedded J, and dropped it > > into /Applications (the proper place for it), then what jpath'~user' > gives > > me is: > > /Applications/belcan.app/Contents/MacOS/user > > > > viz it can't see outside the "bundle". > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
