[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nmh-workers] Getting the location of the of the nmh executables fro

From: norm
Subject: Re: [Nmh-workers] Getting the location of the of the nmh executables from a script
Date: Wed, 28 Jan 2015 10:06:06 -0800

The heuristic I finally settled on is to find the last component of $PATH that
contains, at least, scan, comp, pick, dist, dist, mark, whatnow, and whom. I
figure that nobody would dare get rid of all of those.

Paul Fox <address@hidden> writes:
>ralph wrote:
>> Hi Norm,
>> > Neither 'command -v scan' nor 'which scan' works for me. I want to
>> > name the script, from which I want to know where nmh's scan is
>> > located. "scan". I want to know its location so I can invoke it.
>> OK, so you've your own `scan' script that you want to be found earlier
>> in PATH and have it call the next one that's found if PATH searching
>> continued?  The way I normally do that is to hardcode the path to the
>> next one in line, I must admit.
>in bash, i do:
>mhbin=$(type -p install-mh)  # find the install-mh executable
>mhbin=${mhbin%/*}            # strip the last '/' and anything that follows
>the first line could be replaced by
>mhbin=`which install-mh`
>the second could be replaced by something clever in expr or sed.
>later, my script says:
>$mhbin/comp   # run the real 'comp' command

    Norman Shapiro

reply via email to

[Prev in Thread] Current Thread [Next in Thread]