From: miura@symb.cs.gunma-u.ac.jp (Miura Kinya)
Newsgroups: fj.questions.unix
Subject: Re: add path
Date: 2 Oct 92 07:32:33 GMT
Reply-To: miura@cs.gunma-u.ac.jp
Distribution: fj

$@;01:!VHsC1D4!W6VLi$H?=$7$^$9!%(J

from article <SANPEI.92Oct2121839@poisson.kw.phys.keio.ac.jp>,
	by sanpei@kw.phys.keio.ac.jp (Yoshiro Mihira):
> $@?tCM7W;;$r$9$k$H$-$K;H$&%W%m%0%i%`$J$I$rF~$l$k(J
> $@%G%#%l%/%H%j$N(J path $@$r2C$($?$$$J$H;W$$!"(JMS-DOS
> $@$NMM$K9M$($F!"(Jpath $@$rESCf$G2C$($l$P$H;W$$$^$7$?!#(J
> 
> $@HFMQ@-$,$J$$%W%m%0%i%`$J$N$G(J(fft $@$7$F$/$l$k%W%m%0%i%`$d(J
> $@GH$r=PNO$9$k%W%m%0%i%`$J$I(J)$@IaDL$N(J .cshrc $@$+$i(J
> $@FHN)$7$FF~$l$?$$$H;W$$$^$7$?!#(J($@$=$N?tCM<B83$r$9$k$H$-$K(J
> path $@$r2C$($k(J)

$@;29M$K$J$k$+$I$&$+$o$+$j$^$;$s$,!$;d$O$3$s$J$3$H$r$7$F$$$^$9!%(J($@%7%'%k$O(J
csh$@$G$9(J)

$@FCDj$NMQES$N%3%^%s%I$r=8$a$?%G%#%l%/%H%j(J(/usr/hosts, /usr/sccs,
/usr/local/mh $@$J$I$J$I(J) $@$N0l$D0l$D$K$D$$$F!$(J~/.bin ($@$3$l$O9%$_(J)$@$N2<$K(J 
???.bin $@$H$$$&L>A0$N%7%s%\%j%C%/%j%s%/$r:n$C$F$*$-$^$9!%(J(ln -s
/usr/hosts ~/.bin/hosts.bin $@$H$+(J)

$@$=$&$7$F$*$$$F!$(Jatt, det, atmt $@$H$$$&(J($@5?;w(J)$@%3%^%s%I$r2<5-$N$h$&$KDj5A$7(J
$@$^$9!%$3$&$9$k$H!$$3$l$i$N%G%#%l%/%H%j$r<+M3$KCe$1$?$j30$7$?$j$G$-$^$9!%(J
$@$3$s$J46$8(J($@D9$$9T$O0lIt@Z$C$F$"$j$^$9!%(J#$@0J2<$O%3%a%s%H$G$9(J):

symb%1 att    # $@C1$K(Jatt$@$HF~$l$k$H!$8=:_IU$1$i$l$F$$$k%G%#%l%/%H%j$rI=<($9$k(J
ATTACHMENT:  
symb%2 printenv PATH
/home/sf/miura/.bin:/usr/ucb:/bin:/usr/bin:/usr/local/bin:/usr/new:.
symb%3 att hosts
ATTACHMENT: hosts  
symb%4 printenv PATH
/home/sf/miura/.bin/hosts.bin:/home/sf/miura/.bin:/usr/ucb:/bin:....
symb%5 att sccs
ATTACHMENT: sccs hosts  
symb%6 printenv PATH
/home/sf/miura/.bin/sccs.bin:/home/sf/miura/.bin/hosts.bin:....
symb%7 det hosts
ATTACHMENT: sccs
symb%8 printenv PATH
/home/sf/miura/.bin/sccs.bin:/home/sf/miura/.bin:/usr/ucb:/bin:....
symb%9 det sccs
ATTACHMENT: 
symb%10 printenv PATH
/home/sf/miura/.bin:/usr/ucb:/bin:/usr/bin:/usr/local/bin:/usr/new:.
symb%11 atmt  # $@C1$K(Jatmt$@$HF~$l$k$H!$IU$1$i$l$k%G%#%l%/%H%j$rI=<($9$k(J
X11 games hosts mh sccs tran vcs wnn
symb%12 atmt mh  # ~/.bin/mh.bin $@$NFbMF$rI=<($9$k(J
<<sccs>>
admin		delget		get		prt		sccsdiff
cdc		delta		help		rmdel		unget
comb		diffs		helpdir		sact		val
create		edit		prs		sccs.drv	what
symb%13 

att, det, atmt $@$NDj5A(J:

==== .cshrc ====
	:
alias att 'set ARGV="\!*";source ~/.bin/Att;unset ARGV'
alias det 'set ARGV="\!*";source ~/.bin/Det;unset ARGV'
	:

==== ~/.bin/Att ====
if(! $?ATTACHMENT) setenv ATTACHMENT ' '
foreach i ($ARGV)
	if( "$ATTACHMENT" =~ *\ $i\ * )then
		echo "att: attachment $i has already exists. (ignored)"
	else if( -d ~$USER/.bin/$i.bin )then
		set path=(~$USER/.bin/$i.bin $path)
		setenv ATTACHMENT " $i$ATTACHMENT"
	else
		echo "att: attachment $i is unknown. (ignored)"
	endif
end
echo "ATTACHMENT:$ATTACHMENT"
unset i

==== ~/.bin/Det ====
# path handling
#
set path2=
foreach i ($path)
	foreach j ($ARGV)
		if( $i == ~/.bin/$j.bin )set i=
	end
	set path2=($path2 $i)
end
set path=($path2)
unset path2

# change env
#
set att=
foreach i ($ATTACHMENT)
	foreach j ($ARGV)
		if( $i == $j )set i=
	end
	set att=($att $i)
end
setenv ATTACHMENT " $att "
echo "ATTACHMENT: $att"
unset att

==== atmt ====
#!/bin/sh
cd $HOME/.bin
if [ $# = 0 ] ; then
        echo `ls -d *.bin | sed -e 's/\.bin//g'`
else
        for x in $* ; do
                echo "<<$x>>"
                ls $x.bin
                done
fi

==================
$@!V(J20A $@@83h<T!W(J
$@;01:!VHsC1D4!W6VLi(J			$@!!72GOBg3X9)3XIt>pJs9)3X2J(J