On Thu, Jan 08, 2004 at 03:22:04PM +1100, DE LUCA Ben wrote: > I was wondering if people would like to talk about some of the things that > you might be able to do with some simple utilities that are included with > most Linux distros. > > I spent a few days over the holidays learning more about screen and I can > say it was truly worth it. I was wondering if a few people might like to > join me in discussing some of the cool things about a particular utility > each week? > > There was some talk of screen earlier this week and I wondered if we might > like to talk about some of the cool functions or even bad ones for the rest > of the week!
Screen is very worthy, but pipe is da bomb! (Pipe-Bomb?) cat Zechariah\ Vulgate.txt | perl -lane'print "lynx -source http://www.perseus.tufts.edu/cgi-bin/morphindex?lang=la\\&embed=2\\&lookup=$F[$_] | grep \\<G\\> | perl -pe \"s\/\\<.*?\\>\/;\/g; print qq[$F[0].$_;$F[$_];];\"" foreach 1..$#F' | sh | cut '-d;' -f1,2,8,13 | perl -nle'my ($vw,$mw,$dw,$dd) = split(/\;/); $dd =~ s/^Entry in $//;$dd &&= " \"$dd\"";print qq[$vw $mw : $dw$dd]' This little beauty took the Latin words from the Vulgate version of the book of Zechariah (Old Testament), plugged them into a webpage which gave the alternate meanings, ripped out the meanings and re-formatted them into one Latin word and alternate meaning per line, so my friend (PHD at Sydney Uni) could remove the wrong meanings and have a word for word translation. Pipe lets you build up programs on the command line, tie together simple tools (grep/cut/sed/awk/lynx/wget/sh/perl/convert) and see how you are going. I particularly like getting perl to print out commands which I pipe to sh. If you want to get started, try: a one-liner which sets todays dilbert comic as your background image in x. splitting a logfile into daily or hourly logfiles using grep, bc, head, tail cheers, Woody -- SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/ Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html
