remove bash 4.0+ redirections

use >file 2>&1 instead of &>
pull/58/head
Simon Let 6 years ago
parent fbf0291d4b
commit 9a35e44d42
  1. 4
      scripts/hooks.sh
  2. 4
      scripts/install.sh
  3. 4
      scripts/util.sh

@ -16,7 +16,7 @@ __resh_preexec() {
__resh_collect --cmdLine "$__RESH_CMDLINE" \ __resh_collect --cmdLine "$__RESH_CMDLINE" \
--recall-actions "$__RESH_HIST_RECALL_ACTIONS" \ --recall-actions "$__RESH_HIST_RECALL_ACTIONS" \
--recall-strategy "$__RESH_HIST_RECALL_STRATEGY" \ --recall-strategy "$__RESH_HIST_RECALL_STRATEGY" \
&>~/.resh/collect_last_run_out.txt || echo "resh-collect ERROR: $(head -n 1 ~/.resh/collect_last_run_out.txt)" > ~/.resh/collect_last_run_out.txt 2>&1 || echo "resh-collect ERROR: $(head -n 1 ~/.resh/collect_last_run_out.txt)"
} }
# used for collect and collect --recall # used for collect and collect --recall
@ -156,7 +156,7 @@ __resh_precmd() {
-gitRemoteExitCodeAfter "$__RESH_GIT_REMOTE_EXIT_CODE_AFTER" \ -gitRemoteExitCodeAfter "$__RESH_GIT_REMOTE_EXIT_CODE_AFTER" \
-realtimeAfter "$__RESH_RT_AFTER" \ -realtimeAfter "$__RESH_RT_AFTER" \
-timezoneAfter "$__RESH_TZ_AFTER" \ -timezoneAfter "$__RESH_TZ_AFTER" \
&>~/.resh/postcollect_last_run_out.txt || echo "resh-postcollect ERROR: $(head -n 1 ~/.resh/postcollect_last_run_out.txt)" > ~/.resh/postcollect_last_run_out.txt 2>&1 || echo "resh-postcollect ERROR: $(head -n 1 ~/.resh/postcollect_last_run_out.txt)"
fi fi
__resh_reset_variables __resh_reset_variables
fi fi

@ -42,7 +42,7 @@ else
fi fi
if ! zsh --version &>/dev/null; then if ! zsh --version >/dev/null 2>&1; then
echo " * Zsh version: ? - not installed!" echo " * Zsh version: ? - not installed!"
else else
zsh_version=$(zsh -c 'echo ${ZSH_VERSION}') zsh_version=$(zsh -c 'echo ${ZSH_VERSION}')
@ -135,7 +135,7 @@ if [ -f ~/.resh/resh.pid ]; then
else else
pkill -SIGTERM "resh-daemon" || true pkill -SIGTERM "resh-daemon" || true
fi fi
nohup resh-daemon &>/dev/null & disown nohup resh-daemon >/dev/null 2>&1 & disown
# Generating resh-uuid ... # Generating resh-uuid ...
[ -e ~/.resh/resh-uuid ] \ [ -e ~/.resh/resh-uuid ] \

@ -43,7 +43,7 @@ __resh_run_daemon() {
if [ -n "$ZSH_VERSION" ]; then if [ -n "$ZSH_VERSION" ]; then
setopt LOCAL_OPTIONS NO_NOTIFY NO_MONITOR setopt LOCAL_OPTIONS NO_NOTIFY NO_MONITOR
fi fi
nohup resh-daemon &>~/.resh/daemon_last_run_out.txt & disown nohup resh-daemon >~/.resh/daemon_last_run_out.txt 2>&1 & disown
} }
__resh_bash_completion_init() { __resh_bash_completion_init() {
@ -142,6 +142,6 @@ __resh_session_init() {
-osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \ -osReleaseIdLike "$__RESH_OS_RELEASE_ID_LIKE" \
-osReleaseName "$__RESH_OS_RELEASE_NAME" \ -osReleaseName "$__RESH_OS_RELEASE_NAME" \
-osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \ -osReleasePrettyName "$__RESH_OS_RELEASE_PRETTY_NAME" \
&>~/.resh/session_init_last_run_out.txt || echo "resh-session-init ERROR: $(head -n 1 ~/.resh/session_init_last_run_out.txt)" > ~/.resh/session_init_last_run_out.txt 2>&1 || echo "resh-session-init ERROR: $(head -n 1 ~/.resh/session_init_last_run_out.txt)"
fi fi
} }

Loading…
Cancel
Save