People I Hope To Someday Meet

1) Jack Pickle
2) Cyrus Niftypants
3) Peter Wasabi Peters
4) Nancy Treaty-Tweety
5) Eleanor Wonderdrier
6) Chester Noble Balls
7) H. Livid
8) Pudgely Goober
9) Ira Antipasto
10) Harry Gut
11) Thom Thom Olgersonowicz
12) Hubley Mumps
13) Yanni Chrome
14) Alabaster Cranberry
15) Dr. Piffle
16) His Honorable Jumpsuit Algae Ring Toss
17) Sue Hug
18) Crazy Will Carburetor
19) Iris Anagram
20) Hops Sprightly

UNIX Script Goodness And Variable Prefix/Suffix Stripping Fun


Here’s something you probably have no interest in, but it’s a script I wrote to help me with UNIX shell programming that I engage in from time to time.

There’s a nice way of easily taking a piece of text (often called a “String” by programmer-types) and stripping off pieces of it, either from the front or the back, using variable evaluation.

One thing to note about UNIX is that are many, many different ways to do the same thing. This is just one little feature of UNIX I like to use.

I wrote a script to help me when I want to do this prefix/suffix stripping kind of variable evaluation.

Here is the script in its entirety:

function showUsage {
print
print ‘USAGE:’
print ‘ksh -f variableTest.sh
print
print ‘=============================================================================================================’
print ‘${variable#pattern} evaluates variable, but removes the smallest portion of its prefix which matches pattern.’
print ‘${variable##pattern} evaluates variable, but removes the largest portion of its prefix which matches pattern.’
print ‘${variable%pattern} evaluates variable, but removes the smallest portion of its suffix which matches pattern.’
print ‘${variable%%pattern} evaluates variable, but removes the largest portion of its suffix which matches pattern.’
print ‘=============================================================================================================’
print
print ‘Special instructions:’
print ‘======================’
print ‘To stop the shell from interpreting wildcards you may use for patterns,’
print ‘run this script like the following:’
print
print ‘ksh -f variableTest.sh
print
print EXAMPLE: ksh -f variableTest.sh aabbcc \’a*\’
print
print
exit 1
}

clear

if [ $# -ne 2 ]
then
showUsage
fi

variable=$1
pattern=$2

print
print ‘=============================================================================================================’
print ‘${variable#pattern} evaluates variable, but removes the smallest portion of its prefix which matches pattern.’
print ‘${variable##pattern} evaluates variable, but removes the largest portion of its prefix which matches pattern.’
print ‘${variable%pattern} evaluates variable, but removes the smallest portion of its suffix which matches pattern.’
print ‘${variable%%pattern} evaluates variable, but removes the largest portion of its suffix which matches pattern.’
print ‘=============================================================================================================’
print
print ‘variable: ‘ $variable
print ‘pattern: ‘ $pattern
print
print ‘${variable#pattern} ‘ ${variable#$pattern}
print ‘${variable##pattern} ‘ ${variable##$pattern}
print ‘${variable%pattern} ‘ ${variable%$pattern}
print ‘${variable%%pattern} ‘ ${variable%%$pattern}

Most of this script is just printing stuff out to the screen. There’s a whole big piece of code that just tells you how to run the script.

Anyways, say you want to find out what directory you are in on a UNIX file system, and want to save this off in a variable, but without all the nested subdirectories your directory rests in (UNIX is all about the nested subdirectories).

You can use this script to figure out the right pattern to get your current directory minus the path.

Example:

Let’s say I’m in:
/usr/appl/abc/very/very/long/directory

After some trial and error running my script, I can eventually figure out how to get my current directory, minus the path.


>ksh -f variableTest.sh /usr/appl/abc/very/very/long/directory ‘*/’

variable: /usr/appl/abc/very/very/long/directory
pattern: */

${variable#pattern} usr/appl/abc/very/very/long/directory
${variable##pattern} directory
${variable%pattern} /usr/appl/abc/very/very/long/directory
${variable%%pattern} /usr/appl/abc/very/very/long/directory

Your current working directory (including the path) is stored in a variable called $PWD.

So, to get your current working directory only in a script you are writing, you can just write the following line:


MY_DIRECTORY=${PWD##*/}

Why did I write a script to do this? Because I can never remember how the pattern matching works, and thought it would be easier to write a script to show me instead.

Now, you’re probably asking me, “Splotchy, why would you put something in a program that many, including you, do not fully understand or remember how it works?”

As Matty Boy would say, that’s a great question, hypothetical question asker!

One thing that I neglected to mention about UNIX programming is that it is notoriously squirrelly. And this feature I am making use of is pretty damned squirrelly, too.

Negative Space Signage Update


Since I recently provided an update regarding A Blog Of Notes, I thought I’d also update you on another blog, The Signage of Negative Space.

In the two months this blog has been running, we have documented seventy-three instances of negative space signage.

I have complete confidence we will reach one hundred signs and beyond.

Besides me, there are currently four other contributors of signage photos:

Freida Bee (Austin, Texas)
PJ (London)
Tim (Springfield, Illinois)
Thornton (Boston, Massachusetts)

I really can’t adequately convey my happiness at having other people participate in this blog. It’s really quite, quite nifty to post photos from different people living in different parts of the globe.

I know that I have the occasional blog readers from different geographical regions, Missouri, Tennessee, New York, California, etc., that have yet to have their own negative space signage represented.

If you want to make this BoingBoing-neglected wreck the happiest l’il blogger this side of the Mississippi, I hope you’ll consider looking around for negative space signage in your neck of the woods.

Stay Negative,

Splotchy

A Blog Of Notes Is Getting Progressively Awesomer

A Blog Of Notes, the newish audio blog that Tim and myself have been working on, keeps getting awesomer.

As we are nearing the end of the month, we have strung all the audio files of March 2008 together into a single, easily-played sound file (we’re calling these collections of monthly sounds a “compile”).

Go here to listen to the March compile that Tim has so skillfully constructed.

Yes, we are also providing a March compile with a backing drumbeat, thank you for asking!

Here Come The Birds

The birds are coming back. I saw some robins last week, and have seen a lot of cardinals flying around behind our house. I found some information regarding cardinals indicating that they are not migratory, but despite this I don’t recall seeing one around here in the winter.

Anyways, I got back from shopping this afternoon, and had my handheld digital voice recorder with me. I don’t really recognize birdsongs, but I know what a cardinal sounds like.

There was one high up in a tree right next to our garage. I was in a blissful enough moment to stop and record it for a bit.

If you listen closely you can hear another cardinal in the distance (perhaps answering its call?).

A Movie Quote Meme With A Doodle Happy Ending

Hi, here’s a belated movie quote meme completed on behalf of Mathman.

Rules:

1. Here are quotes from 15 of my favourite movies.
2. See if you can name the films from whence they were lifted.
3. No googling or IMDBing; I’m trusting you on this.
4. I’ll post the film names as they’re correctly identified.

My additional rule:
5. Person(s) with the most correct answers can supply a doodle idea for me to doodle.

The Quotes:

1. “What does Operations care about a bunch of damn books? A book in Dutch. A book out of Venezuela. Mystery stories in Arabic.”
Three Days of the Condor [Matty Boy]

2. “Life mocks me even in death!”
An American Werewolf In London [Never Identified!]


3. “Well, I’ve been to one world fair, a picnic, and a rodeo, and that’s the stupidest thing I ever heard come over a set of earphones.”
Dr. Strangelove [Matty Boy]

4. “I saved Latin. What did you ever do?”
Rushmore [Cowboy The Cat]

5. “Don’t be so gloomy. After all it’s not that awful. Like the fella says, in Italy for 30 years under the Borgias they had warfare, terror, murder, and bloodshed, but they produced Michelangelo, Leonardo da Vinci, and the Renaissance. In Switzerland they had brotherly love – they had 500 years of democracy and peace, and what did that produce? The cuckoo clock.”
The Third Man [Becca]

6. “Back home, they put me in jail for what I’m doing. Here, they give me awards. “
Casino [SamuraiFrog]

7. “I heard about Doc, and I know why he did it. Somebody took away his painting privileges.”
Escape From Alcatraz [Becca]

8. “Oh, ho ho! You sly dog! You got me monologuing! I can’t believe it.”
The Incredibles [J.D.]

9. “You’re a very attractive man, Ken. You’re… smart, you’ve got wonderful bones, great eyes, and you dress really interestingly.”
A Fish Called Wanda [Tim]

10. “Ask him, Edie, how come he’s so good at killing people?”
A History Of Violence [J.D.]

11. “You are named after the dog?”
Indiana Jones and the Last Crusade [Cowboy The Cat]

12. “Pay strict attention to what I say because I choose my words carefully and I never repeat myself.”
Inside Man [J.D.]

13. “What was Raymond doing with his hands?”
The Manchurian Candidate (1962) [SamuraiFrog]


14. “I think my body’s getting used to these 36-hour days.”
Primer [Never Identified!]

15. “Lisa, whatever female-driven, emotion-based dilemma you may be dealing with right now, you have my sympathy. But for the sake of time and sanity, let’s break this down into a little male-driven fact-based logic. One simple phone call saves your dad’s life. “
Red Eye [Lonie Polony]

UPDATE!

To make this a meme with an amazingly happy ending, I have decided to offer my doodling services for *anyone* that was the first to correctly answer any of the questions.

I await your doodle ideas!

DOODLE UPDATE!

For Lonie Polony: Danny Zucco in Greased Lightning (how about Zucco in front of Greased Lightning? I should have read your request a little more carefully!)

For SamuraiFrog: A walrus typing on a laptop that’s starting to explode.

For Tim: Working from home.

For J.D.: John McCain channeling The Hulk breaking a baby lamb in half, with the blood dripping onto a poster for Blade Runner

For Becca: Wonder Woman dancing with Mario (from Mario Brothers)

jung vf fcybgpul?