in reply to Script to change $ENV{PATH}
This is replaced by:PATH =`munch.pl $PATH`
to put in .cshrc if you are using csh or tcsh.setenv PATH `munch.pl $PATH`
#!/usr/bin/perl -w use strict; my @comp = split /:/,shift; my %saw = (); @saw{@comp} = (); print join ":",keys %saw;
This gives the following under bash:
and the following under csh:$ TEST="a:b:c:a:c:z:a:b:z" $ echo $TEST a:b:c:a:c:z:a:b:z $ TEST=`tmp/test.pl $TEST` $ echo $TEST a:z:b:c
> setenv TEST "a:b:c:a:c:z:a:b:z" > echo $TEST a:b:c:a:c:z:a:b:z > setenv TEST `tmp/test.pl $TEST` > echo $TEST a:z:b:c
Hope that helps....
Cheers
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Script to change $ENV{PATH}
by TheHobbit (Pilgrim) on May 08, 2003 at 10:02 UTC |