On Thu, Apr 2, 2009 at 3:16 PM, Jan Schampera <jan.schamp...@web.de> wrote:
> Mike Coleman wrote:
>> [Oops--I sent that incomplete.]
>>
>> It would be nice if there was some really brief syntax for
>>
>>     $(type -p somecommand)
>>
>> I find myself using this all day long with 'ls', 'file', 'ldd',
>> 'strings', 'nm', etc., and the current incantation is just long enough
>> to be annoying.
>>
>> Mike
>>
>>
>
> Why do you need to get the path of a program that's in PATH?

Well, for example, I may have an undocumented program 'foobar' in my
path, and running 'strings' on it is a good way to grab its usage
message and/or look at its embedded messages, etc.  I might run 'ldd'
on it to see what libs it's depending on, 'ls' to see when it was last
updated, who owns it, etc., 'file' to see what it is (script or
executable, 32-bit or 64, etc.).

Obviously for all of these, I could do a 'type -p' first and then
paste the result in as the argument for these other commands, but it's
handy not to have to do that.  Currently I have a whole bunch of
aliases (pls, pfile, pldd, pstrings, etc.) to do this, but it seems
like a useful enough pattern that it'd be worth having a general
shortcut for it.

Mike


Reply via email to