chiark / gitweb /
bin/mdw-conf, dot/bashrc, setup: Portability fixes.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 25 Jun 2011 13:21:58 +0000 (14:21 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 25 Jun 2011 13:23:39 +0000 (14:23 +0100)
bin/mdw-conf
dot/bashrc
setup

index 86da2caf86b2fdbd76d8af59e8fb88fe3517772c..4ee6d775df10d73af6d7f7b32e57f8efcca61933 100755 (executable)
@@ -4,7 +4,7 @@ set -e
 var=${1?var}
 val=$(
   sed -n "
-    /^[         ]*$var[         ]*=[    ]*\(\|.*[^      ]\)[    ]*$/ {
+    /^[         ]*$var[         ]*=[    ]*\(.*[^        ]\)\{0,1\}[     ]*$/ {
       s//\1/; p; q
     }
   " ${MDWCONF-$HOME/.mdw.conf})
index 69af4a1d07af68a5d928cf69c577e3b2fd01706f..c26fad38cab93136c1157eb265d67347a4269373 100644 (file)
@@ -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 d5111d82576a540a95a3299608f4a23e576261f4..74db46e11d80c4d0ed28d5041f55bbb6eed79786 100755 (executable)
--- 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\a\a$HOME\ag
 /@releasekey@/ s\a\a$(bin/mdw-conf release-key 481334C2)\ag