It probably depends on your shell. But most shells should have the "which"
builtin
$ which scan
/usr/local/nmh/bin/scan
If you want to be super portable, there's probably a way to separate
the PATH variable using : as your delimeter and check echo entry
for $dir/scan ... but I can't get the splitting-up part to happen
off the top of my head.
--hymie! http://lactose.homelinux.net/~hymie
hymie(_at_)lactose(_dot_)homelinux(_dot_)net
norm(_at_)dad(_dot_)org writes:
How, from a script, can I get the location of the nmh executables. I don't
mean the location of the "fancy" executables that `mhparam libexecdir`
gets me, but the location of the "user" executables, like scan.
Yes, I know, it will be in $PATH, but I want to make sure that I get
the right component of $PATH.
Norman Shapiro
_______________________________________________
Nmh-workers mailing list
Nmh-workers(_at_)nongnu(_dot_)org
https://lists.nongnu.org/mailman/listinfo/nmh-workers