wblock@ said:Interesting:
% man sh | less -p Dollar-Single
jrm said:In the second example, he uses column() to pretty print the pasted groups so the columns align properly. This only works if you supply the $'\t' for the -s switch. Why doesn't this work with just '\t'? In other words what does the $ mean in front of '\t'?
% echo before$'\t\t'after
before after
wblock@ said:
column -s $'\t'
column -s [B]"[/B]\t[B]"[/B]
column -s "[color="Red"]{ctrl-v}{tab}[/color]" (actual ctrl-v and tab keystrokes)
I did do some data mining work when I was busying with my graduate thesis on "Data Mining based Internet Application Classification", at that time I learned and used awk and plain shell script to manipulate raw data before I threw them into Weka to build some perfect mathematic models. It's really interesting.UNIXgod said:Nice info. Lots of fun filtering examples.
What sort of data mining are you specifically interested in?
wblock@ said:
- If the first operand is -n, or if any of the operands contain a backslash ( '\' ) character, the results are implementation-defined.
- On XSI-conformant systems escape characters such as '\t' will print a TAB.
- The printf utility can be used portably to emulate any of the traditional behaviors of the echo utility as follows...
- New applications are encouraged to use printf instead of echo.
% /bin/echo before "\t\t" after
before \t\t after
tcsh % echo before "\t\t" after
before \t\t after
sh % echo before "\t\t" after
before \t\t after
eshell % echo before "\t\t" after
("before" "\\t\\t" "after")
eshell % echo "before \t\t after"
before \t\t after
zsh % echo before "\t\t" after
before after
YZMSQ said:I did do some data mining work when I was busying with my graduate thesis on "Data Mining based Internet Application Classification", at that time I learned and used awk and plain shell script to manipulate raw data before I threw them into Weka to build some perfect mathematic models. It's really interesting.![]()
jrm said:Some interesting points from the POSIX specification of echo are:
Code:% /bin/echo before "\t\t" after before \t\t after tcsh % echo before "\t\t" after before \t\t after sh % echo before "\t\t" after before \t\t after eshell % echo before "\t\t" after ("before" "\\t\\t" "after") eshell % echo "before \t\t after" before \t\t after zsh % echo before "\t\t" after before after
$ printf before"\t"after"\n"
before after
$ printf before$'\t'after$'\n'
before after
$ echo before$'\t'after$'\n'
before after
$ echo before"\t"after"\n"
before\tafter\n