Henry -
This sounds like a different but similar problem I have when I run my
backups: I want to name my backup directory differently according to the
machine on which I'm running.
I use my own "whoami", which simply invokes the OS version of this command
and parses the result like this:
whoami=: 3 : 0
sess=. spawn 'net config workstation'
sess=. dsp&.><;._1 LF,sess-.CR NB. Vec of lines
sess=. ><;._1&.> ' ',&.>,sess NB. Mat of words
strs=. 'COMPUTER';<'USER' NB. Strings to key on
wh=. (<toupper&.>0{"1 sess)e.&.> <&.>strs NB. Which lines start with
strings
wh=. ;b2i&.>(<(toupper&.>1{"1 sess)e. <'NAME')*.&.>wh
wh{2{"1 sess
NB.EG 'machine userid'=. whoami ''
)
whoami ''
+--------------+---------------+
|\\NY0193FF51XX|devon_mccormick|
+--------------+---------------+
I can then use the machine name to customize the target name.
Also, along the lines of Dan's suggestion, is there some reason why you
can't dynamically update the contents of USERFOLDERS_j_ with the altered
drive letter? This would allow you to use something like "~MyDir" and alter
its definition per installation.
Regards,
Devon
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm