made workaround for implementations of sed that don't understand -E more robust

also made it compatible with POSIX shells
This commit is contained in:
Gregory Pakosz 2019-06-09 12:40:37 +02:00
parent 8f808316b1
commit 915d4a3960
1 changed files with 2 additions and 1 deletions

View File

@ -180,7 +180,8 @@ run 'cut -c3- ~/.tmux.conf | sh -s _apply_configuration'
# if ! printf '' | sed -E 's///' 2>/dev/null; then # if ! printf '' | sed -E 's///' 2>/dev/null; then
# if printf '' | sed -r 's///' 2>/dev/null; then # if printf '' | sed -r 's///' 2>/dev/null; then
# sed () { # sed () {
# command sed "${@/-E/-r}" # n=$#; while [ "$n" -gt 0 ]; do arg=$1; shift; case $arg in -E*) arg=-r${arg#-E};; esac; set -- "$@" "$arg"; n=$(( n - 1 )); done
# command sed "$@"
# } # }
# fi # fi
# fi # fi