From 2464dac5c121307ce71877332d7a7b19fe653b95 Mon Sep 17 00:00:00 2001 From: Frank Terbeck Date: Thu, 11 Mar 2010 00:48:44 +0100 Subject: [PATCH 1/1] zshrc: Make minimal-shellrc printf-free One of the major reasons for `minimal-shell()' is to be able to use it without /usr being mounted. But some OS vendors think it's smart to put `printf' into /usr/bin - sed, of course happily lives in /bin. Debian happens to think that's funny, too. mksh doesn't make `printf' a builtin because it doesn't want to link libm in (well, you can hack it in - but that's a discouraged non- default). This replaces "printf '%s' foo' with "print -r -- foo", which should resolve the issue for us nicely. --- etc/minimal-shellrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/etc/minimal-shellrc b/etc/minimal-shellrc index dec53b5..1a5a9c2 100644 --- a/etc/minimal-shellrc +++ b/etc/minimal-shellrc @@ -43,7 +43,7 @@ if [[ -x $(which infocmp) ]] && [[ -x $(which sed) ]] ; then while read -r line ; do key="${line%=*}" [[ "${key}" != k* ]] && continue - seq="$(printf '%s' "${line#*=}" | sed -e 's,\\\([1-7][0-7]*\),\\0\1,g')" + seq="$(print -r -- "${line#*=}" | sed -e 's,\\\([1-7][0-7]*\),\\0\1,g')" seq="$(print "${seq}")" case "$key" in key_left) bind "${seq}"='backward-char' ;; -- 2.1.4