From: Alec Warner Date: Sat, 22 Apr 2006 20:08:55 +0000 (-0000) Subject: A sed wrapper for OSX/BSD courtesy of Flameeyes and Spanky X-Git-Tag: v2.1_pre10~84 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=3012da4bbca2bd690dd2e0ee806ae8caa300d8f0;p=portage.git A sed wrapper for OSX/BSD courtesy of Flameeyes and Spanky svn path=/main/trunk/; revision=3190 --- 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