From 82e1dbabf647beb06b6c0ebf5b22aeb208a04bc3 Mon Sep 17 00:00:00 2001 From: LAN-TW Date: Tue, 13 Dec 2011 23:20:54 +0800 Subject: bash_include: 修正回收筒在 GNU/Linux 上無法使用的問題 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bash_include | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bash_include b/bash_include index f4fa2ee..8dadcaa 100644 --- a/bash_include +++ b/bash_include @@ -23,6 +23,8 @@ HISTSIZE=1000000 HISTFILESIZE=1000000 HISTCONTROL=ignoredups:ignorespace +REALPATH_PROGRAM="realpath" + @@ -320,7 +322,7 @@ function trash_mv () split_arguments "$@" while [ "${arglist[$i]}" ] do - original_path="`realpath "${arglist[$i]}"`" + original_path="`$REALPATH_PROGRAM "${arglist[$i]}"`" current_time=`date "+%Y%m%d-%H%M%S"` better_time=`date "+%Y-%m-%d %H:%M:%S"` dirname="`basename "${arglist[$i]}" | sed -e 's/-/_/g' -e 's/ /_/g'`" @@ -533,6 +535,8 @@ check_important_files startcolor prehistory_backup +[ "`uname`" = "Linux" ] && REALPATH_PROGRAM="readlink -f" + umask 0022 echo "Setting key binding" -- cgit