When it comes to UNIX shell-scripting I need all the help I can get.  It’s hard trying to do something new because getting to the right info requires reading many manual pages.  Here are commands I learned to find the latest version of a file that has a timestamp in its filename.  Suppose the files are

myFile.2008-05-01.12.45.01

myFile.2008-05-01.12.46.02

myFile.2008-05-01.12.47.03

and they’re in a directory with many other files, and you want to find the myFile with latest time, then issue this command in the directory of myFile:

ls -l | awk '/myFile/ {print $NF}' | tail -n 1
 

Ok, so what does this do?

“ls -l” prints the files in the current directory, one file per line, in ascending sorted order.  This output is passed to awk, which evaluates each line, searching for the pattern myFile, and for each line with myFile, it separates the words by whitespace, and prints the last field, which is the filename.  The list of such filenames is then passed to tail -n 1, which simply prints the last file in the list.  The result should be what we want.  Of course, if there are other files such as myFileABC, then this command won’t work.  We’ll need a more specific regular expression pattern in the awk command.

Can anyone do it simpler?  Please share.  Thanks.

In a UNIX shell terminal, a prompt indicates the shell is ready for a command. An example:

$

PS1 is the environment variable that determines what the prompt is.  Change it to change the prompt.

For example: PS1=${PWD}> ‘ will set the prompt to display “current_directory> “.  Pay attention to the single quotes.  Using double quotes may have a different effect.

To keep your new prompt each time you log in, set PS1 in your .profile file in your home directory.

Play around.  Different shells require different symbols.  Here are some more examples.

In bash, I use: PS1=’\[\e]0;\w\a\]\n\[\e[32m\]\u@\h\[\e[0m\]\n\$ ‘

In ksh, I use: PS1=’${HOSTNAME?}:${PWD?}’`echo “\n> “‘

Tell me what you are using.

Hellboy IIFrom the depths of Hollywood hell, comes this un-adoring sequel of our beloved horn-shaving, big red, devil tail, superstar HellBoy.  The look of the film has director Guillermo del Toro’s touch, but the story telling lacks his magic.  The story-line was bloated.  The dialog was dumb.  The characters were boring.  Yes, Big Red felt like he should have been in bed and on not on the set.  And that sums up the movie, things didn’t feel right.

As an action movie, HellBoy 2 is hampered and weighed down by fake character development scenes. It’s this mix-mash of poorly done sub-plots that makes the movie silly, dumb, and boring.

Liz, the fire-girl, is having relationship problems over living with HellBoy.  The issue: trivial woman stuff that’s glossed over with key-phrases like “more space”, and “you don’t get it”.  Of course, we never really get it because it’s never really revealed.  That’s silly.  The problem here is fake conflict for more drama.  Later on, Liz finds out she’s pregnant.  Oh brother! is the HellBoy franchize really going there?

Meanwhile, HellBoy wants to be loved by the humans he not-so-secretly lives among.  But after rescuing a baby from a giant, green, elemental bean-stalk thingy, the crowd of New Yorkers boo him.  They shout that it’s his fault or something or other.  But wait, when did this anti-HellBoy sentiment started?  And didn’t they see him save the baby? That’s dumb.

And Abe has more of a role, too.  The main plot unfolds as follows:  An elven princess runs from her evil twin brother, keeping away the third piece of the golden crown which when made whole will give the wearer of noble blood absolute rule over the indestructible Golden Army.  Wouldn’t you know it, Abe falls in love with the princess. Ahh. And an un-romantic affair follows. That’s boring.

HellBoy 2 was too much of a mix of unrelated smaller stories.  Scenes felt fake and didn’t tie together nicely.  The visuals are certainly the better part: the creatures are bizarre, the costumes lovely, the lighting gorgeous, and the fighting decent.

Contrary to the rating on RottenTomatoes, which gave HellBoy 2 88%, I’ll give it 73%, the standard percentage of an equivalent letter grade B after a curve.  The pretty colors moved me up.