Is it by design or am I missing something? If I do a DSPUSRPRF on the
screen, I see the home directory (HOMEDIR) at the end. When I do it in
a file (OUTFILE), no home directory is around anymore...
Is there any other CL command which would put in a file this home
directory for further processing?
Thank you,
S
struct passwd *pw;
char *hoedir;
pw = getpwnam(usrprf);
homedir = pw->pw_dir;
--
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAñejoAlcoolInside
Spaccamaroni andate a cagare/Spammers not welcome
Spamers iros a la mierda/Spamers allez vous faire foutre
Spammers loop schijten/Spammers macht Euch vom Acker
If it's by design, it's a very poor design IMHO. Same command gives
different results when different output options are given, sounds like
MS Windows to me.
I wonder was there any logic behind this 'design' or it's just a bug
which was later labeled 'we wanted it so'...
But thank you for the answer, I'll see what I can do - I would love to
avoid compiling programs when I can use scripts instead (should that
be the case).
All the best,
S
Since you mention "scripts", you could use QSH (QShell) to get the
information you want. If you enter QSH and type the following commands, you
end up with an IFS file that has all the information you want, I believe:
system 'DSPUSRPRF THEUSER' > /home/myuserid/dspusrprf.txt
cat dspusrprf.txt
(...blah, blah, blah)
Home directory . . . . . . . . . . . . . . : /home/THEUSER
--
Joel S. Mueller
"Soterro" <send_lotsa...@yahoo.com> wrote in message
news:1a63f162.03062...@posting.google.com...
Theoretically yes. But that way the command gives you the
human-formatted form of the output, which is very messy to interpret.
Add the fact that I expect the output to be in different languages, so
the fields are in different order, have different names, have even
different values... believe me, I gave it some thoughts and I cannot
be done unless you program a neuronal network :)
Thank you,
S
Messy CL solution (not recommended):
DSPUSRPRF OUTPUT(*PRINT) and then
CRTPF FILE(QTEMP/MYSPLF) RCDLEN(132) followed by
CPYSPLF FILE(QPUSRPRF) TOFILE(QTEMP/MYSPLF) SPLNBR(*LAST)
and then read the QTEMP/MYSPLF either in CL or some HLL programming
language (i.e. RPG).
Parsing the resulting 132 character string is relatively simple no
matter whether English or other national language.
Why parse a spool file when DSPUSRPRF also has OUTFILE capabilities?
--
Regards,
Francis (Address is filtered by SpamCop)
"When once you have tasted flight, you will forever walk the Earth with your
eyes turned skyward, for here you have been, and there you will always long
to return."
--Leonardo da Vinci
There is no need to use unix-like APIs. You can retrieve all of the
posix related user profile attributes using the Retrieve User
Information (QSYRUSRI) API format USRI0300.
Home directory is a little gnarly because it comes back in a
offset-based structure with fields indicating the value in in UCS2 CCSID
(i.e. 2-bytes per chatracter).
Though having no outfile parameter, the simple RTVCURDIR command might perharps fit your needs ?
Mercury
--
Dr.Ugo Gagliardelli,Modena,ItalyCertifiedUindoscrasherAńejoAlcoolInside
Thanks a lot to you all.
Finally I reached the conclusion to use unix-like api's in a small
handmade utility called here and there in the scripts. I'm much more
familiar with C and the unix world plus the scripts are actually in
QSH, so as long PASE is quite usable (starting with V5R1) I'll stress
on it. Ok, I might be also among the lucky ones having an AIX system
handy to do the development :)
Again thank you,
S