🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.unix.shell
Article #1745

Re: Alias to change path on the fly - ALTERNATIVE

#1745
From: Paul Davey
Date: Sat, 10 Nov 1990 15:41
34 lines
2037 bytes
In article <1990Nov8.014515.13882@cpsc.ucalgary.ca> paquette@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@x.co.uk          IXI Limited
	Paul Davey		 pd@ixi.uucp         62-74 Burleigh St.
				 ...!uunet!ixi!pd    Cambridge  U.K.
 "These are interesting times"   +44 223 462 131     CB1  1OJ      
Technical Details
Message-ID: <PAUL.90Nov10154152@cheshire.ixi.uucp>
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!acorn!ixi!ixi!paul
References: <1990Nov8.014515.13882@cpsc.ucalgary.ca>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!attcan!uunet!mcsun!ukc!acorn!ixi!ixi!paul
From: paul@ixi.uucp (Paul Davey)
Newsgroups: comp.unix.shell,comp.unix.internals,comp.unix.programmer
Subject: Re: Alias to change path on the fly - ALTERNATIVE
Message-ID: <PAUL.90Nov10154152@cheshire.ixi.uucp>
Date: 10 Nov 90 15:41:52 GMT
References: <1990Nov8.014515.13882@cpsc.ucalgary.ca>
Sender: paul@x.co.uk (Paul Davey)
Organization: IXI Ltd.
Lines: 34
In-Reply-To: paquette@cs-sun-fsa.cpsc.ucalgary.ca's message of 8 Nov 90 01:45:15 GMT