Revision 9366
Added by Aaron Marcuse-Kubitza over 11 years ago
util.sh | ||
---|---|---|
159 | 159 |
echo "$result" |
160 | 160 |
} |
161 | 161 |
|
162 |
sed_ere_flag="$(test "$(uname)" = Darwin && echo E || echo r)" |
|
162 |
sed_cmd="command sed -$(test "$(uname)" = Darwin && echo E || echo r)" |
|
163 |
alias sed="$sed_cmd" |
|
163 | 164 |
|
164 |
sed() { self -"$sed_ere_flag" "$@";} |
|
165 |
fi # load new aliases |
|
166 |
if self_being_included; then |
|
165 | 167 |
|
166 | 168 |
rtrim() { sed 's/[[:space:]]+$//' <<<"$1"; } |
167 | 169 |
|
Also available in: Unified diff
lib/sh/util.sh: sed: changed it to an alias so it will also be expanded when passed to an external command (like in_place) that can only run an executable, not a shell function (this occurs as long as the external command is defined as an alias which ends in space, to alias-expand the next word). added associated $sed_cmd var for cases when there is no alias wrapper around the external command, and the literal alias body must be used instead.