From: Mark Wooding Date: Sat, 25 Jun 2011 13:21:58 +0000 (+0100) Subject: bin/mdw-conf, dot/bashrc, setup: Portability fixes. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/profile/commitdiff_plain/2b5d45809130a620dfd27d640d9f75d2bd71b877 bin/mdw-conf, dot/bashrc, setup: Portability fixes. --- diff --git a/bin/mdw-conf b/bin/mdw-conf index 86da2ca..4ee6d77 100755 --- a/bin/mdw-conf +++ b/bin/mdw-conf @@ -4,7 +4,7 @@ set -e var=${1?var} val=$( sed -n " - /^[ ]*$var[ ]*=[ ]*\(\|.*[^ ]\)[ ]*$/ { + /^[ ]*$var[ ]*=[ ]*\(.*[^ ]\)\{0,1\}[ ]*$/ { s//\1/; p; q } " ${MDWCONF-$HOME/.mdw.conf}) diff --git a/dot/bashrc b/dot/bashrc index 69af4a1..c26fad3 100644 --- a/dot/bashrc +++ b/dot/bashrc @@ -35,8 +35,8 @@ if [ -t 0 ]; then ## highlight when I'm running as some other user. Highlight when this ## isn't the outermost shell on the terminal. if (( EUID == 0 )); then - left=`echo « | iconv -f utf8 -t //translit` - right=`echo » | iconv -f utf8 -t //translit` + left=`echo « | iconv -f UTF-8 -t //translit` + right=`echo » | iconv -f UTF-8 -t //translit` else case $USER in mdw|mwooding) u="" left="[" right="]" ;; diff --git a/setup b/setup index d5111d8..74db46e 100755 --- a/setup +++ b/setup @@ -186,8 +186,8 @@ for d in $dotfilessubst; do dir=${ft%/*} mkdir -p $dir sed " -1i\ -### generated by $here/setup; do not edit!\ +1i\\ +### generated by $here/setup; do not edit!\\ /@home@/ s$HOMEg /@releasekey@/ s$(bin/mdw-conf release-key 481334C2)g