Bug#218530: 'type' and 'command -v' don't work on posh
On Tue, Jun 22, 2004 at 03:48:19PM +0200, Thomas Hood wrote:
> 'type' and 'command -v' don't work on posh.
>
> The which command works, of course, but it is in /usr/bin/.
>
> $ cd /
> jdthood@thanatos:/$ posh
> $ type ls
> posh: type: not found
> $ command ls
> bin dev etc initrd lost+found mntcdrom proc sbin sys usr
> boot dev.tar home lib mnt opt root share tmp var
> $ command -v ls
> command: invalid option -- v
FWIW, checking the program is in the path is not sufficient you need to check
it is executable:
bash-2.05a$ which foo
/usr/local/bin/foo
bash-2.05a$ ls -l /usr/local/bin/foo
-rw-r--r-- 1 root staff 0 Jun 10 01:46 /usr/local/bin/foo
(command -v and type -p has the same problem.)
so it should be:
if [ -x `which foo` ] ; then
fi
Anyway, look at debhelper-generated maintainer scripts for example.
Cheers,
--
Bill. <ballombe@debian.org>
Imagine a large red swirl here.
Reply to: