Use 'read' built-in instead of $(cat ... | head -n1)

master
Olivier Mengué 2014-01-13 09:16:28 +01:00 committed by Jordan Harband
parent 78ff9a2215
commit f1b8cf8fd6
1 changed files with 1 additions and 1 deletions

2
nvm.sh
View File

@ -74,7 +74,7 @@ nvm_rc_version() {
local NVMRC_PATH local NVMRC_PATH
NVMRC_PATH="$(nvm_find_nvmrc)" NVMRC_PATH="$(nvm_find_nvmrc)"
if [ -e "$NVMRC_PATH" ]; then if [ -e "$NVMRC_PATH" ]; then
NVM_RC_VERSION=`cat "$NVMRC_PATH" | head -n 1` read NVM_RC_VERSION < "$NVMRC_PATH"
echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>" echo "Found '$NVMRC_PATH' with version <$NVM_RC_VERSION>"
fi fi
} }