Re: ping
On Sun, Nov 13, 2022 at 10:24:13PM -0500, Jeffrey Walton wrote:
> On Sun, Nov 13, 2022 at 3:54 PM Klaus Singvogel
> <deb-user-ml@singvogel.net> wrote:
> >
> > peter@easthope.ca wrote:
> > > root@joule:/home/root# /bin/ping -c 3 192.168.0.12
> > > PING 192.168.0.12 (192.168.0.12) 56(84) bytes of data.
> > > 64 bytes from 192.168.0.12: icmp_seq=1 ttl=64 time=0.079 ms
> > > 64 bytes from 192.168.0.12: icmp_seq=2 ttl=64 time=0.114 ms
> > > 64 bytes from 192.168.0.12: icmp_seq=3 ttl=64 time=0.113 ms
> > > ...
> > But my hottest solution in your report is an alias.
> > Having an alias of ping will never be reported by "which" neither. So I can imaging you've defined ping as an alias.
> > And as Greg said, try "type ping" to find this out (and not "which ping").
>
> As far as I know, `command -v ping` is the Posix way. It is portable,
> and it shows shell aliases and other user environment changes.
It doesn't appear to give useful output for functions.
unicorn:~$ type ls
ls is a function
ls ()
{
if [ -t 1 ]; then
command ls --color -F "$@";
else
command ls "$@";
fi
}
unicorn:~$ command -v ls
ls
But sure, the OP could provide the output of "command -v ping" in addition
to "type ping". It couldn't hurt.
Reply to:
- Follow-Ups:
- Re: ping
- From: Tim Woodall <debianuser@woodall.me.uk>
- References:
- ping
- Re: ping
- From: Klaus Singvogel <deb-user-ml@singvogel.net>
- Re: ping
- From: Jeffrey Walton <noloader@gmail.com>