Front page
Silflay Hraka?

Bigwig is a systems administrator at a public university
Hrairoo is the proprietor of a quality used bookstore
Kehaar works at a regional newspaper
Woundwort is a professor of counseling at a private university

The Hraka RSS feed

bigwig AT

Friends of Hraka
Daily Pundit
cut on the bias
Meryl Yourish
This Blog Is Full Of Crap
Winds of Change
A Small Victory
Silent Running
Dr. Weevil
Little Green Footballs
Fragments from Floyd
The Feces Flinging Monkey
Dean's World
Little Tiny Lies
The Redsugar Muse
Natalie Solent
From the Mrs.
The Anti-Idiotarian Rottweiler
On the Third Hand
Public Nuisance
Not a Fish
Electric Venom
Skippy, The Bush Kangaroo
Common Sense and Wonder
Neither Here Nor There
The Greatest Jeneration
Ipse Dixit
Blog On the Run
Redwood Dragon
Greeblie Blog
Have A Cuppa Tea
A Dog's Life
Iberian Notes
Midwest Conservative Journal
A Voyage to Arcturus
Trojan Horseshoes
In Context
The People's Republic of Seabrook
Country Store
Blog Critics
Chicago Boyz
Hippy Hill News
Kyle Still Free Press
The Devil's Excrement
The Fat Guy
War Liberal
Assume the Position
Balloon Juice
Iron Pen In A Velvet Glove
Freedom Lives
Where Worlds Collide
Knot by Numbers
How Appealing
South Knox Bubba
Heretical Ideas
The Kitchen Cabinet
Bo Cowgill
Raving Atheist
The Short Strange Trip
Shark Blog
Ron Bailey's Weblog
Cornfield Commentary
Northwest Notes
The Blog from the Core
The Talking Dog
WTF Is It Now??
Blue Streak
Smarter Harper's Index
nikita demosthenes
Bloviating Inanities
Sneakeasy's Joint
Ravenwood's Universe
The Eleven Day Empire
World Wide Rant
All American
The Rant
The Johnny Bacardi Show
The Head Heeb
Viking Pundit
Oscar Jr. Was Here
Just Some Poor Schmuck
Katy & Bruce Loebrich
But How's The Coffee?
Roscoe Ellis
Sasha Castel
Susskins Central Dispatch
Josh Heit
Aaron's Rantblog
As I was saying...
Blog O' Dob
Dr. Frank's Blogs Of War
Betsy's Page
A Knob for Brightness
Fresh Bilge
The Politburo Diktat
Drumwaster's rants
Curt's Page
The Razor
An Unsealed Room
The Legal Bean
Helloooo chapter two!
As I Was Saying...
SkeptiLog AGOG!
Tong family blog
Vox Beth
I was thinking
Judicious Asininity
This Woman's Work
Fragrant Lotus
Single Southern Guy
Jay Solo's Verbosity
Snooze Button Dreams
You Big Mouth, You!
From the Inside looking Out
Night of the Lepus
No Watermelons Allowed
From The Inside Looking Out
Lies, Damn Lies, and Statistics
Suburban Blight
The SmarterCop
Dog of Flanders
From Behind the Wall of Sleep
Beaker's Corner
Bad State of Gruntledness
Who Tends The Fires
Granny Rant
Elegance Against Ignorance
Say What?
Blown Fuse
Wait 'til Next Year
The Pryhills
The Whomping Willow
The National Debate
The Skeptician
Zach Everson
Geekward Ho
Life in New Orleans
Rotten Miracles
The Biomes Blog
See What You Share
Blog dElisson
Your Philosophy Sucks
Watauga Rambler
Socialized Medicine
Verging on Pertinence
Read My Lips
The Flannel Avenger
Butch Howard's WebLog
Castle Argghhh!
Andrew Hofer
Moron Abroad
White Pebble
Darn Floor
Pajama Pundits
Goddess Training 101
A & W
Medical Madhouse
Slowly Going Sane
The Oubliette
American Future
Right Side Redux
See The Donkey
Newbie Trucker
The Right Scale
Running Scared
Ramblings Journal
Focus On Reality
Wyatt's Torch

May 23, 2002

Why they do that

They do that because it is their lot in life. You may as well ask Andrew Sullivan why he pisses people off.

:1,$s/^.*MP3 // and :1,$s/ .*:... /-/ are what is known as regular expressions. Put simply, they are patterns. Put simply, the sentence before this one is a lie. They contain regular expressions, but they also contain other stuff. I can get away with this because all the real technical people read Camworld, and only come round here at two-thirty in the morning, after all the bars close, looking to get laid. And no, they don't respect me in the morning. Hell, they don't respect me at two-thirty.

When I took this line;

AFROM~19 MP3 4,975,989 08-23-01 11:07p AfroMan - Because I Got High.mp3,

and got this line;

4,975,989-AfroMan - Because I Got High.mp3,

it was because I specified a pattern that first matched AFROM~19 MP3, and then matched 08-23-01 11:07p. Once they got matched, the rest of the command deleted them. I could have just typed "AFROM~19 MP3" but that would have only worked once. The pattern has to be loose enough to find something on every line in the document, but tight enough so that it's not deleting the information I want to keep. With your kind permission, I'll parse the first one.

: actually isn't part of the "reg ep", as they call it in the biz..... Well, I think they do. I do, certainly, and the fact that long-haired Star Trek freaks in need of a bath look at me funny when I do doesn't mean a THING! I CAN BE GEEK CHIC TOO! I KNOW WHAT 42 MEANS, I CAN QUOTE MONTY BLOODY PYTHON, I ....

Ahem. : is actually a command in Unix's vi editor that allows you to issue commands against all or part of he document you are working on. And it's pronounced "vee-aye", not "six", as I know, to my great and enduring sorrow. Typing : allows me to proceed with the rest of the command.

1,$ - says that I am going to be searching through the entire document, from the first character (1), to the last ($). Not actually part of the regular expression.

s - substitute. It says to replace the first thing in the pattern with the second thing. Also not actually part of the regular expression.

^.*MP3 - the first thing in the pattern. The / in front of it essentially says "here begins the first thing". The / after it says "Here endeth the first thing. Right after me begins the second thing". The pattern it is searching for says "Match anything that is found at the beginning of a line (^), is followed by one or more characters(.*) and ends in MP3 (MP3) followed by a space ( )". Actually the regular expression.

/ - the second thing. Well, there is no thing there. The / means "Here endeth the second thing. Since there is nothing there, I've essentially deleted whatever fits the pattern. Again, not actually part of the regular expression.

You may ask, why isn't there just a delete command? There is. I didn't learn it until after i had fallen into the "replace with nothing" habit, so I hardly ever use it.

:1,$s/ .*:... /-/ is more of the same, other than the pattern it is looking for . It parses as "Match anything that is one or more characters(.*), followed by colon(:) followed by exactly three characters and a space (... ), and repace all that with dash (-).

Phear my L33t skillz.

Posted by Bigwig at May 23, 2002 10:20 PM | TrackBack
First time visitor to House Hraka? Wondering if everything we produce could possibly be as brilliant/stupid/evil/pedantic/insipid/inspired as the post you just read? Check out the Hraka Essentials, the (mostly) reader-selected guide to Hraka's best posts, and decide for yourself.
Post a comment Note: Comments with more than two dashes per line will be blocked as spam.

Remember personal info?