| ||||||
| 5/17 |
| 2001/4/20-22 [Computer/SW/Unix] UID:21039 Activity:moderate |
4/20 How come sed -e 's/[\ \t\n]/ /g' doesn't work for the tab and \n?
\_ obUsePerl
perl -pe 's/[\s\n]/ /g'
\_ perl -pe 's/\s/ /g' is sufficient --dbushong
\_ This is ugly, but it works for tab:
sed -e 's/'"`echo \"\t\"`"'/ /g'
Oh, and what's the point of matching SPACE, TAB, and NEWLINE
instead of just TAB and NEWLINE? Replacing SPACE with SPACE?
\_ you mean /bin/echo right? echo (shell command) wouldn't
work. Also maybe the guy means 's/[\s]+/ /g'
\_ yup, /bin/echo or /usr/bin/echo |