summaryrefslogtreecommitdiff
path: root/bin/sed
diff options
context:
space:
mode:
authorAlec Warner <antarus@gentoo.org>2006-04-22 20:08:55 +0000
committerAlec Warner <antarus@gentoo.org>2006-04-22 20:08:55 +0000
commit3012da4bbca2bd690dd2e0ee806ae8caa300d8f0 (patch)
treeb735e3745a7ead641033a1abdbc39d2681f76b97 /bin/sed
parentDisable sandbox during package phase interaction with $PKGDIR for compatibili... (diff)
downloadportage-multirepo-3012da4bbca2bd690dd2e0ee806ae8caa300d8f0.tar.gz
portage-multirepo-3012da4bbca2bd690dd2e0ee806ae8caa300d8f0.tar.bz2
portage-multirepo-3012da4bbca2bd690dd2e0ee806ae8caa300d8f0.zip
A sed wrapper for OSX/BSD courtesy of Flameeyes and Spanky
svn path=/main/trunk/; revision=3190
Diffstat (limited to 'bin/sed')
-rw-r--r--bin/sed22
1 files changed, 22 insertions, 0 deletions
diff --git a/bin/sed b/bin/sed
new file mode 100644
index 00000000..615bd1c6
--- /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