On Tuesday, June 4, 2002, at 03:17 , David T-G wrote:
[..]
>
> You should be able to split on colons...
>
> [zero] [5:16pm] ~> perl -e 'foreach $p \
> (split (/:/,$ENV{PATH})){print "$p\n"}'
first off my complements on the skank - although you know and I know
the fine person wanted something more on the order of
my @pathElements = split(/:/, $ENV{PATH});
foreach my $elem (@pathElements ) {
print "I see \$elem <$elem> in your PATH\n";
}
which generates
I see $elem </usr/bin> in your PATH
I see $elem </bin> in your PATH
I see $elem </home/drieux> in your PATH
since the person clearly wants to effectively use this in a
real perl script and not merely....
> /home/davidtg/local/Linux-2.4.5-i686/bin
[..]
> /home/davidtg/bin
> /usr/local/bin
[..]
> /usr/ucb
> /usr/openwin/bin
> /usr/X11R6/bin
[..]
> /usr/games
no one puts 'games' in their PATH line any more....
[..]
> /opt/SUNWspro/bin
> /usr/ccs/bin
> /usr/ccs/lib
> /usr/dt/bin
> /opt/sw/rvplayer5.0b3
I don't mean to be crass here or anything David - but is
it just me or have you become a bit cluttered in your PATH
element - and should seriously think about resolving whether
you are on a linux box or a solaris box and hence set your
path element accordingly... It really is not that difficult
a trick to do...
try something like
setenv ARCH `perl -MConfig -e 'print $Config{osname}'`
or which ever your KULT fave login world is, and then sort
out which path thingies belong where - ala
if( $ARCH == "sgi" ) then
.....
else if ( $ARCH == solaris ) then
.....
else if ( $ARCH == linux ) then
....
else if ( $ARCH == darwin ) then
....
endif
Please just because you are about to go mental is no
reason to keep cluttering up all your shells with the
fact that you have zoned out....
show some back bone man....
besides it will help your FNG's as they go
"uh dude, like I ripped off your .login and .cshrc files
uh, and like why do you, uh do......"
{ ok, so like as if my .login and .cshrc files have not bloated
over the mumble, mumble, mumble years..... }
ciao
drieux
---
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]