Zsh Mailing List Archive
Messages sorted by:
Using 'command -v' in a shellscript results in a coredump
- X-seq: zsh-users 7882
- From: Michael Prokop <news@xxxxxxxxxxxxxxxxx>
- To: zsh-users@xxxxxxxxxx
- Subject: Using 'command -v' in a shellscript results in a coredump
- Date: Thu, 19 Aug 2004 01:29:21 +0200
- Mail-followup-to: zsh-users@xxxxxxxxxx
- Mailing-list: contact zsh-users-help@xxxxxxxxxx; run by ezmlm
- Reply-to: Michael Prokop <zsh@xxxxxxxxxxxxxxxxx>
on my system /bin/sh is a symlink to /bin/zsh4 (version 4.2.1).
I noticed a strange behaviour with the following shellscript:
command -v blub > /dev/null 2>&1
Running it results in 'zsh: segmentation fault (core dumped)'.
Running the script with /bin/sh pointing to /bin/bash does not
produce a core dump.
Regarding to the zsh-manual 'command' is defined as:
,---- [ man zsh ]
| command [ -pvV ] simple command
| The simple command argument is taken as an external command
| instead of a function or builtin and is executed. If the
| POSIX_BUILTINS option is set, builtins will also be executed but
| cer- tain special properties of them are suppressed. The -p
| flag causes a default path to be searched instead of that in
| $path. With the -v flag, command is similar to whence and with -V,
| it is equivalent to whence -v.
Regarding to "IEEE Std 1003.1-2001, Section 12.2, Utility Syntax
Guidelines" 'command -v' is defined as:
,---- [ command -v ]
| (On systems supporting the User Portability Utilities option.) Write
| a string to standard output that indicates the pathname or command
| that will be used by the shell, in the current shell execution
| environment (see Shell Execution Environment ), to invoke
| command_name, but do not invoke command_name.
I'm not sure whether it's a bug in the shellscript (use of
non-sh-code) or the behaviour of zsh in sh-mode isn't correct.
Could anyone please explain me what's going on?
Thanks && regards,
".signature" [New] 1L, 22C [w]
Messages sorted by: