On Wed, 2008-10-22 at 20:14 +0200, Florian Kulzer wrote: > On Tue, Oct 21, 2008 at 11:31:27 -0700, Ken Teague wrote: > > Florian Kulzer wrote: > > > [ snip: the config file sets and exports LD_LIBRARY_PATH and other > > > environmental variables. ] > > > <<Snipped>> > > Awesome! However, acuSim has a suite of binaries (e.g. acuSim, > > acuSolve, acuTrace, etc.) and each of these binaries accept different > > args. All of the binaries are under > > /usr/local/bin/acusim/LINUX64/V1.7e/bin. How can I adapt the script to > > handle the various binaries? Will I have to add a bunch of case > > statements?... or is there an easier way? > <<Snipped>> > Since this is in /usr/local, you could try the following solution. You mention the binaries you want are in a separate 'bin' directory, which I presume is added to your PATH. So, first, remove that PATH element from your startup files. Then, in /usr/local/bin create a single file named to match one of the binary file names, for example: # vi acuSim Put this in the file: #!/bin/bash PATH=/usr/local/bin/acusim/LINUX64/V1.7e/bin:$PATH source /usr/local/bin/acusim/LINUX64/V1.7e/script/.acusim-sh # Because some shells put a full path in $0 (IIRC) and, sometimes, you # may use /usr/local/bin/prog to start it, but we just need to program # name. prog=$(basename $0) # This will run the program found in /.../acusim/... since that is # first in the path now, with any args found for the script, exactly # as given on the original command line. exec $prog "$@" # END script Then create links to the above file for each program you want to run. For this case, I prefer hard links, but symlinks will also work. Now, you can run the desired acc* program or any other executable, same shell/terminal window, without conflicts. -- Bob McGowan
Attachment:
smime.p7s
Description: S/MIME cryptographic signature