Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [linuxtools-dev] Two solutions for the $PATH problem

Oops.  I sent this email to the wrong mailing list.  My apologies.


On 09/28/2011 04:29 PM, Corey Ashford wrote:
> I talked briefly with Jeff Johnston and he made the point that you can
> use a script to get around this problem of not having PATH set at the
> time command is invoked.  In fact, this approach is already taken in
> org.eclipse.linuxtools.profiling.launch.createProcess.  Basically, you
> create a [remote] file, and fill it with
> 
> #! /bin/sh
> <commmand> <args...>
> 
> Then run it by executing "/bin/sh <name of created file>".  Because this
> new shell will have the $PATH variable set completely, you will get the
> correct executable.
> 
> The second approach is a little better in my opinion because you don't
> have to create any [remote] files.  That solution is to call
> "/usr/bin/which <command>" with the $PATH set as you like.  Because
> /usr/bin/which works with the $PATH that is passed to it, it should
> return the absolute path of the correct executable to use.  Then you
> just use that path to run the desired tool.
> 
> - Corey
> _______________________________________________
> linuxtools-dev mailing list
> linuxtools-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/linuxtools-dev



Back to the top