3 # Copyright (C) 2004 Free Software Foundation, Inc.
5 # This script is free software; the Free Software Foundation gives
6 # unlimited permission to copy, distribute and modify it.
8 # Invoke a shell script with the same name two directories up from this
9 # file. Robust against all kinds of pathological file and directory
10 # names, as well as all kinds of pathological shells.
11 # By Nathanael Nerode, Zack Weinberg, and Alexandre Oliva.
13 # Insert "../../" just before the last slash in the pathname.
14 # We use a here-document to avoid problems with "echo" and
15 # pathnames containing backslashes or a leading dash.
17 script=`sed 's,[^/]*$,../../&,' << EOF
22 # Must honor CONFIG_SHELL if set.
23 # Simple "$@" does the wrong thing for zero arguments with
24 # OSF/1 4.0 /bin/sh, possibly others.
25 # ${1+"$@"} does the wrong thing with zsh (== /bin/sh in
26 # some iterations of Darwin).
29 0) exec ${CONFIG_SHELL-/bin/sh} "$script" ;;
30 *) exec ${CONFIG_SHELL-/bin/sh} "$script" "$@" ;;