[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: `missing' needs patch for Ultrix4.4
From: |
Jim Meyering |
Subject: |
Re: `missing' needs patch for Ultrix4.4 |
Date: |
19 Mar 2001 09:56:49 +0100 |
User-agent: |
Gnus/5.090001 (Oort Gnus v0.01) Emacs/21.0.101 |
Alexandre Oliva <address@hidden> wrote:
| On Mar 17, 2001, Jim Meyering <address@hidden> wrote:
|
| > * missing (--run): Use `eval' to run `"$@"'. Otherwise, Ultrix4.4's
| > /bin/sh fails and outputs garbage.
|
| Won't this evaluate the arguments one too many times?
Thanks! You're right.
| How about:
|
| prog=$1
| shift
| $prog ${1+"$@"} && exit 0
But wouldn't that'd have the same problem, in the unlikely event
that $1 contains shell meta-characters. How about this instead?
Index: missing
===================================================================
RCS file: /cvs/automake/automake/missing,v
retrieving revision 1.12
diff -u -p -r1.12 missing
--- missing 2000/10/16 09:01:36 1.12
+++ missing 2001/03/19 08:54:35
@@ -30,7 +30,16 @@ case "$1" in
# Try to run requested program, and just exit if it succeeds.
run=
shift
- "$@" && exit 0
+ # This is convoluted because using `"$@" && exit 0' doesn't
+ # work with some shells (at least Ultrix4.4's /bin/sh).
+ case "$@" in
+ :)
+ : && exit 0
+ ;;
+ *)
+ ( exec "$@" ) && exit 0
+ ;;
+ esac
;;
esac
- `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/17
- Re: `missing' needs patch for Ultrix4.4, Alexandre Oliva, 2001/03/18
- Re: `missing' needs patch for Ultrix4.4,
Jim Meyering <=
- Re: `missing' needs patch for Ultrix4.4, Akim Demaille, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Akim Demaille, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Akim Demaille, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Akim Demaille, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Akim Demaille, 2001/03/19
- Re: `missing' needs patch for Ultrix4.4, Jim Meyering, 2001/03/19