Re:Useful Unix commands for exploring data
by jeroenjanssens on Wednesday August 27, 2014 @12:40PM
(#8233049)
Try `body`: https://github.com/jeroenjanssens/data-science-at-the-comman...
[ Parent
| on HN ]
Re:Useful Unix commands for exploring data
by vram22 on Wednesday August 27, 2014 @03:33PM
(#8234255)
Heh, at first I thought you meant a body command like this one, which I've written in the past:
$ cat body_test.txt
1 This
2 is
3 a
4 file
5 to
6 test
7 the
8 body
9 command
10 which
11 is
12 a
13 complement
14 to
15 head
16 and
17 tail.
$ cat `which body`sed -n $1,$2p $3
$ body 5 10 body_test.txt
5 to
6 test
7 the
8 body
9 command
10 which
Re:Useful Unix commands for exploring data
by faulteh on Thursday August 28, 2014 @10:33PM
(#8240887)
Immediately ^'d this post for it's usefulness, but I put this in my .bashrc instead:
function body_alias() {
sed -n $1,$2p $3
}alias body=body_alias
I used to have little scripts like body in my own ~/bin or /usr/local/bin but I've been slowly moving those to my .bashrc which I can copy to new systems I log on to.
Re:Useful Unix commands for exploring data
by vram22 on Saturday August 30, 2014 @04:07PM
(#8247435)
Glad you liked it. Your alias technique is good too. Plus it may save a small amount of time since the body script does not have to be loaded from its file (as in my case) - unless your *nix version caches it in memory after the first time.