author | Jay Soffian <jaysoffian@gmail.com> | |
Thu, 6 Oct 2011 18:25:55 +0000 (14:25 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Thu, 6 Oct 2011 20:24:59 +0000 (13:24 -0700) | ||
commit | d30db5605b03a45b2848fa9131c3485dc93f7dad | |
tree | ea1d54aaab59c2617037033dc36fcf1e82ae1734 | tree | snapshot |
parent | e923eaeb901ff056421b9007adcbbce271caa7b6 | commit | diff |
merge-one-file: fix "expr: non-numeric argument"
When invoking expr to compare two numbers, don't quote the
variables which are the output of 'wc -c'. On OS X, this output
includes spaces, which expr balks at:
$ sz0=`wc -c </etc/passwd`
$ sz1=`wc -c </etc/passwd`
$ echo "'$sz0'"
' 3667'
$ expr "$sz0" \< "$sz1" \* 2
expr: non-numeric argument
$ expr $sz0 \< $sz1 \* 2
1
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
When invoking expr to compare two numbers, don't quote the
variables which are the output of 'wc -c'. On OS X, this output
includes spaces, which expr balks at:
$ sz0=`wc -c </etc/passwd`
$ sz1=`wc -c </etc/passwd`
$ echo "'$sz0'"
' 3667'
$ expr "$sz0" \< "$sz1" \* 2
expr: non-numeric argument
$ expr $sz0 \< $sz1 \* 2
1
Signed-off-by: Jay Soffian <jaysoffian@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-merge-one-file.sh | diff | blob | history |