1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-13 05:43:53 -05:00

reads only the first word from file

This commit is contained in:
Yamashita Yuu
2014-03-24 19:23:36 +09:00
parent ea9214bb2e
commit 34065dddbb
2 changed files with 5 additions and 7 deletions

View File

@@ -9,14 +9,12 @@ if [ -e "$VERSION_FILE" ]; then
# Read the first non-whitespace word from the specified version file.
# Be careful not to load it whole in case there's something crazy in it.
IFS="${IFS}"$'\r'
words=( $(cut -b 1-1024 "$VERSION_FILE") )
words=( $(cut -b 1-1024 "$VERSION_FILE" | awk '{ print($1) }') )
versions=("${words[@]}")
if [ -n "$versions" ]; then
OLDIFS="$IFS"
IFS=:
IFS=":"
echo "${versions[*]}"
IFS="$OLDIFS"
exit
fi
fi