James -- ...and then James Kelty said... % % Hello.
Hello!
%
% I am writing a quick script in order to parse a users $PATH variable, but I
% hit upon a quandry.
%
% The PATH environment is one long string with element separated by a ":", no
% mystery there, but
% how would I look at each individual element? Normally I would use split on a
% line by line basis, but
% this isn't line by line.
You should be able to split on colons...
[zero] [5:16pm] ~> perl -e 'foreach $p \
(split (/:/,$ENV{PATH})){print "$p\n"}'
/home/davidtg/local/Linux-2.4.5-i686/bin
/home/davidtg/local/Linux-i686/bin
/home/davidtg/local/Linux/bin
/home/davidtg/local/bin
/home/davidtg/bin
/usr/local/bin
/usr/local/mysql/bin
/usr/ucb
/usr/openwin/bin
/usr/X11R6/bin
/usr/bin
/bin
/usr/etc
/usr/local/lang
/usr/local/sas
/usr/games
/usr/sbin
/usr/lib/nis
/usr/local/netpbm
/opt/SUNWspro/bin
/usr/ccs/bin
/usr/ccs/lib
/usr/dt/bin
/opt/sw/rvplayer5.0b3
%
% Any advice?
Just the usual... RTFM :-) (In this case, I'm sure it's RTFPod.)
%
% Thanks so much!
HTH & HAND
%
%
% -James
:-D
--
David T-G * It's easier to fight for one's principles
(play) [EMAIL PROTECTED] * than to live up to them. -- fortune cookie
(work) [EMAIL PROTECTED]
http://www.justpickone.org/davidtg/ Shpx gur Pbzzhavpngvbaf Qrprapl Npg!
msg25421/pgp00000.pgp
Description: PGP signature
