diff options
-rw-r--r-- | bin/sed | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/sed b/bin/sed new file mode 100644 index 000000000..615bd1c6f --- /dev/null +++ b/bin/sed @@ -0,0 +1,22 @@ +#!/bin/bash + +if [[ -n ${ESED} ]]; then +exec ${ESED} "$@" +elif type -p gsed > /dev/null ; then +exec gsed "$@" +else +old_IFS="${IFS}" +IFS=":" + +SEARCH=${PATH#*:} +for path in $SEARCH; do +if [[ -x $path/sed ]]; then +exec $path/sed "$@" +exit 0 +fi +done + +IFS="${old_IFS}" +fi + +exit 1 |