On Nov 12, 2012, at 9:32 AM, Fredrik Öhrström wrote: > 12 nov 2012 kl. 17:45 skrev Kelly O'Hair: > >> Looks ok. >> >> xargs used to prune whitespace? That was a new one on me. ;^) > > After reading through this one: > http://stackoverflow.com/questions/369758/how-to-trim-whitespace-from-bash-variable > I can only say that it seemed like the easiest solution...... > > //Fredrik
Interesting. I guess I would have done something like: if [ "`cat file | wc -w`" -ne 0 ] ; then check if we have words... ;^) Or maybe if [ "$(words $(shell cat file))" -ne 0 ] ; then But no big deal, the xargs trick is interesting but I've never trusted xargs to behave exactly the same on all systems. I trust the GNU make macros to behave consistently, and the old unix utilities like cat, wc, etc. -kto