perl -wi -lpe 's/[[:space:]]+//g' file
Note the use of [:space:], the POSIX character class that includes all the whitespace characters. \s will not do, as that does not include the vertical tab character. Newlines won't be removed by the code above, as they are chopped off when reading a line, and added back on when printing it. It's the -l that will do this.
Abigail
In reply to Re: removing all whitespace but newlines
by Abigail-II
in thread removing all whitespace but newlines
by blacksmith
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |