From 3012da4bbca2bd690dd2e0ee806ae8caa300d8f0 Mon Sep 17 00:00:00 2001 From: Alec Warner Date: Sat, 22 Apr 2006 20:08:55 +0000 Subject: [PATCH] A sed wrapper for OSX/BSD courtesy of Flameeyes and Spanky svn path=/main/trunk/; revision=3190 --- bin/sed | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 bin/sed 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 -- 2.26.2