Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/env/cd
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
if __gvm_is_function __gvm_oldcd; then
# output from declare -f on zsh omits a newline before opening brace, so
# we need to add the newline for consistency with bash.
eval "$(echo "cd()"; declare -f __gvm_oldcd | sed '1 s/{/\'$'\n''{/' | tail -n +2)"
eval "$(echo "cd()"; declare -f __gvm_oldcd | sed '1 s/{/\'$'\n''{/' | $TAIL_PATH -n +2)"
unset -f __gvm_oldcd
fi

if __gvm_is_function cd; then
eval "$(echo "__gvm_oldcd()"; declare -f cd | sed '1 s/{/\'$'\n''{/' | tail -n +2)"
eval "$(echo "__gvm_oldcd()"; declare -f cd | sed '1 s/{/\'$'\n''{/' | $TAIL_PATH -n +2)"
elif [[ "$(builtin type cd)" == "cd is a shell builtin" ]]; then
eval "$(echo "__gvm_oldcd() { builtin cd \$*; return \$?; }")"
fi
Expand Down
2 changes: 2 additions & 0 deletions scripts/function/tools
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ GREP_ERROR="GVM couldn't find grep"
EGREP_ERROR="GVM couldn't find egrep"
SORT_ERROR="GVM couldn't find sort"
HEAD_ERROR="GVM couldn't find head"
TAIL_ERROR="GVM couldn't find tail"
HEXDUMP_ERROR="GVM couldn't find hexdump"

LS_PATH=$(unalias ls &> /dev/null; command -v ls) || display_error "$LS_ERROR" || return 1
Expand All @@ -15,4 +16,5 @@ GREP_PATH=$(unalias grep &> /dev/null; command -v grep) || display_error "$GREP_
EGREP_PATH=$(unalias egrep &> /dev/null; command -v egrep) || display_error "$EGREP_ERROR" || return 1
SORT_PATH=$(unalias sort &> /dev/null; command -v sort) || display_error "$SORT_ERROR" || return 1
HEAD_PATH=$(unalias head &> /dev/null; command -v head) || display_error "$HEAD_ERROR" || return 1
TAIL_PATH=$(unalias tail &> /dev/null; command -v tail) || display_error "$TAIL_ERROR" || return 1
HEXDUMP_PATH=$(unalias hexdump &> /dev/null; command -v hexdump) || display_error "$HEXDUMP_ERROR" || return 1