Please note that COLUMNS :
- NOT an environment variable. This is a common bash parameter that is set by bash itself.
- Set automatically after receiving a
SIGWINCH signal.
This second point usually means that your COLUMNS will only be set in your interactive shell, not in a bash script.
If your script stdin connected to your terminal, you can manually view the width of your terminal by querying your terminal:
tput cols
And use this in your SVN command:
svn diff "$@" --diff-cmd /usr/bin/diff -x "-y -w -p -W $(tput cols)"
(Note: you should quote "$@" and stay away from eval )
lhunath May 11 '09 at 7:30 a.m. 2009-05-11 07:30
source share