Sunday July 18, 2004
MCWong
|
| Blah! MCWong |
|
Todd Wins The Open (Todd who?) Todd Hamilton (who?) won his first major! Holding off no less than world no. 2 Ernie Els in a 4 hole playoff. Todd led throughout on Sunday. Still led by 1 after Ernie birdied 17th, Todd start off 18th with a bad tee shot into thick stuff and a worse second short of the green and almost into the crowd, a free drop and a chip that went long, end up making bogey; while Ernie GIR but missed a makeable birdie which could have ended the match. The 4 hole playoff goes from hole 1, 2 and back 17, 18. A mistake in 17th tee par 3 left Ernie with the only bogey of the duo and cost him the claret jug. Phil Mickelson didn't really choke this time (well the monkey's really off his back after Masters) but still came up short and played second fiddle again. Tiger, yet again, didn't matter with a disappointing +1 on Sunday and finished 9th. Lee Westwood seemed to be inspired and shot 67 to finish 4th; Davis Love too finished with 67, who wasn't shown much on prime time TV coverage climbed to 5th. (2004-07-18 10:53:46.0) Permalink ksh scripting #4 : list elements v7 and v8
Alan offered cool advise on ksh scripting #3 with ... and I dig!
So I adapted
Here's pl7() which adapted the
And to add some flexibility, I can cater to user specified delimiters which would have been otherwise messy to do in pl version 1:
Give it a go:
I guess my intention was clear, in that I'm trying to let
PS: Okay why version 7 and 8? it took me that no. of iteration to figure out IFS. ;) ksh scripting flashback: #1 #2 #3 (2004-07-14 00:00:04.0) Permalink Comments [3] ksh scripting #3: list elements It seem unavoidable, at some point there is always some kind of list that needs spliting.
Here's to give it a go:
Why '|' as separator? Well, when was the last time you see this '|' thing in the English language? And, when was the last time you process a bunch of shell command pipelines all concatenated together into a list to be processed? I supposed you get them more often with each pipeline on a separate line, as in a shell script (?!); which you could readily process with read, grep, awk, sed and a zillion other utilities. Why not ':' as in /etc/passwd? I have scripts that process list of URL's, so 'http://...'! Not very convenient isn't it.
ksh scripting flashback: #1 #2 (2004-07-09 00:00:03.0) Permalink Comments [1] ksh scripting #2: unix friendly filename Every time I rip and encode tracks from my CD collections (yes I still buy them) to mp3, I had the need of getting a unix friendly filename from the human readable title since I use Solaris to do everything. I typically grab the titles from a free cddb out there that happens to have my album's details. But these come in various formats such as:
While I need them to be unix friendly, such as:
So I script it with the help of
I'm not even sure if I understand this now that I looked at it again. :(
The ksh scripting flashback: #1 (2004-07-08 00:00:02.0) Permalink Comments [5] True to the tradition of unix, this is as cryptic as it gets, but... elegant [GEEK!]
For those who like filename with obvious indication of it's genre, e.g.
I always use
and any error output,
Since my job does more code reading than writing, what's left is the occasional need to automate some test, so shell does it just fine. Instant and disposable (i.e. no worries about reusable values). Nevertheless, there are a few tricks here and there that I like to remember.
(2004-07-07 00:00:01.0) Permalink After Blackout ... Smallville gets a re-run After the Great Singapore Blackout ('ala Great Singapore Sale), the local free-to-air TV actually decided to re-run the last episode of Smallville. Why am I not particularly excited (I thought I should)? Must be the boring ending that I managed to catch as my area was the first to get electricity back. (2004-07-05 01:23:45.0) Permalink |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||