Alias to change path on the fly - ALTERNATIVE

Paul Davey paul at ixi.uucp
Sun Nov 11 02:41:52 AEST 1990


In article <1990Nov8.014515.13882 at cpsc.ucalgary.ca> paquette at cs-sun-fsa.cpsc.ucalgary.ca (Trevor Paquette) writes:

->    Quick and I hope a fairly simple question. We have some programs
->   that must be able to take advantage of two co-processors on a sun.
->   The executables are name prog_host (no coprocessor), prog_sc (Supercard
->   coprocessor) and prog_qc (Quickcard coprocessor).
->    Each executable is in a seperate directory. I want to be able to change
->   my path on the fly to get at a certain executable. This is what I have
->   done so far.
->   Let's say my path is set as :
->   (. /usr/ucb /bin /usr/bin /usr/local/bin /home/insight/sparc/bin/itahost)
...

lots of mucking around with sed deleted...

As an alternative solution I'd use a symbolic link to the bin and
delete it and recreate it as required.

if your three bins are: /home/insight/sparc/bin/itahost
			/home/insight/sparc/bin/itaqc
			/home/insight/sparc/bin/itasc

set path = (. /usr/ucb /bin /usr/bin /usr/local/bin ~/itabin)

alias host  'rm -f  ~/itabin ; ln -s /home/insight/sparc/bin/itahost'
alias qc    'rm -f  ~/itabin ; ln -s /home/insight/sparc/bin/itaqc'
alias sc    'rm -f  ~/itabin ; ln -s /home/insight/sparc/bin/itasc'

(you don't need to rehash, at least not on my machine)
--
 Regards,			 pd at x.co.uk          IXI Limited
	Paul Davey		 pd at ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ      



More information about the Comp.unix.internals mailing list