On Fri-2010/04/02-17:23 Micah Cowan wrote: > clemens fischer wrote: > >> In the bash-4 I use it >> breaks at least when giving it anything but a number: >> >> Color number g is/ino/bin/color-trans.sh: line 66: [: g: integer >> expression expected >> /ino/bin/color-trans.sh: line 89: [: g: integer expression expected >> >> You have things like `test "$some_var" -lt some_number' all over it. > > Why would that be a problem? "$some_var" is expected to be a number. > > Are you perhaps neglecting the space after "g"? It appears sh is > complaining at line 66, but it shouldn't be in that function unless you > either (a) typed just a number, or (b) typed anything it didn't > otherwise recognize as a command. (Yes, I know, not very robust. I only > hacked it up for my own purposes, didn't bother to clean it up for > others before sending it out.) > > In particular, see the main() function, which strips initial "g " or "c > " (after recognizing them) before passing them along.
I finally get to understand how to use the script. I had typed just "g" and expected "medium grey", so the number was missing. Maybe I'll make it more robust in the face of users like me some day and send the diff. clemens ------------------------------------------------------------------------------ _______________________________________________ tmux-users mailing list tmux-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/tmux-users