bug-bash
[Top][All Lists]
Advanced

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

Re: feature-request: brief syntax for $(type -p somecommand)


From: Bernd Eggink
Subject: Re: feature-request: brief syntax for $(type -p somecommand)
Date: Thu, 02 Apr 2009 23:12:44 +0200
User-agent: Thunderbird 2.0.0.21 (X11/20090302)

Mike Coleman schrieb:
On Thu, Apr 2, 2009 at 11:57 AM, Chris F.A. Johnson <cfaj@freeshell.org> wrote:
  If that's what you want, you can include it in the function:

p()
{
 _p=$( type -p "$@" )
 [ -n "$_p" ] && ls -l $_p
}

This is more or less what I'm doing now, with one function for each
command.  I suppose the command could be an argument, too, so that one
could run

    $ p ls somecommand
    $ p ldd somecommand
    $ p strings somecommand
    $ p file somecommand
    $ p nm somecommand

though there's no command completion this way.  I guess I could add that, too.

One problem, though, like the "wait for slot" feature I suggested a
few months ago, is that something like this is quite a bit more useful
when it's available everywhere (without having to drag one's bash
library around).

I have a more universal function (also named p) here:

        http://www.sudrala.de/en_d/shell-cmdexp.html

Maybe it is of use for you, too.

Regards,
Bernd


--
Bernd Eggink
http://sudrala.de




reply via email to

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