X-Git-Url: https://ruderich.org/simon/gitweb/?a=blobdiff_plain;f=shell%2Ffunctions;h=12874c6228a4f9f1f769729f8610a8d4fda318d8;hb=6b1905f1bf85390391785debd3041ae1b61f225d;hp=10283a393f3903afd5aba46178bc26eb933c4bc4;hpb=614f9080ac810a2f4c0a5244bca856f3358e625e;p=config%2Fdotfiles.git diff --git a/shell/functions b/shell/functions index 10283a3..12874c6 100644 --- a/shell/functions +++ b/shell/functions @@ -1,6 +1,6 @@ # Shell functions useful to all shells. -# Copyright (C) 2011-2012 Simon Ruderich +# Copyright (C) 2011-2014 Simon Ruderich # # This file is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,8 +21,8 @@ # Doesn't fit perfectly in this file, but this is the best place to make it # available everywhere. source_debug() { - if [ x$DEBUG != x ]; then - echo "$@" + if test "x$DEBUG" != x; then + printf '%s' "$*" fi } @@ -30,14 +30,14 @@ source_debug() { source_config() { source_debug "source_config(): $1" - if [ -f $1 ]; then + if test -f "$1"; then source_debug ". $1" - . $1 + . "$1" fi - if [ -f $1.local ]; then + if test -f "$1.local"; then source_debug ". $1.local" - . $1.local + . "$1.local" fi }