Letters

Satisfaction

After having used the internal-built G technologies with my Acer Aspire 3690, I must say with great satisfaction that the Dynex Draft N card is a solid performer. Having used Ubuntu for two years, I'm glad to see that wireless speeds are surpassing those of Windows. Where I live, everyone is wired into Windows, and as an Ubuntu fan for two years, it's amazing to have my laptop running faster than most Windows machines—as well as without the crashes all too common with Vista, my 250GB hard drive automatically working, my 2GB of RAM not conflicting with the system, and my Draft N card pulling its weight. Ubuntu, by far, is one of my favorite operating systems. I'm praying that sooner or later, all laptops and PCs are given the options to have either Windows or Linux as their primary OS.


Joseph Ziehm

It's Happening

I'm behind in my reading and just finished “Linux for the Long Haul” by Michael Surran [LJ, August 2008], about the Houlton Christian Academy's migration from Windows. Like most businesses using Linux, “GHCA has a single Windows machine in our office for the sole purpose of running Intuit's QuickBooks”. Intuit has finally begun to realize that its future is not on the Windows desktop. A version QuickBooks Online that is compatible with Firefox (and other non-IE browsers) is in the works. Now, if we can just get Photoshop....


Joe Holt

Liked That Tech Tip

I really liked the Tech Tip on page 56 of the December 2008 issue. Being a bit of a bug for efficiency, I will mention one possible improvement. However, it may work only with the Bash shell. I am not very familiar with the other shells. I do this sort of thing because Ben Franklin once said: “A cycle saved is a cycle earned!” Or something like that. I've worked on some really slow machines in my day.

The line:

F=$(echo $F| perl -pe 's/.gz$//') 

could be replaced with the line:

F=${1%.gz}

which allows the line:

F=$1

to be eliminated entirely.

And, just because I like to be different, I think that the line:

nice gunzip -c $F

would “look better” if gunzip were replaced with zcat. I think that zcat is simply more “intuitive” than gunzip -c:

nice zcat "$F"

Also notice that I enclosed $F in double quotes just in case there might be one or more blanks in the filename, which would make the unquoted $F look like multiple arguments to the zcat.

Oh, and just as a question, would sed be more efficient than perl here:

F=$(echo "$F"|sed 's/.gz$//')

Just curious on this last one.

Again, many thanks for the tip.


John McKown

Really, Really Liked That Tip

I really did like that tip [see letter above]. Using the idea in it, I created the following two functions that I now sourced by my Bash profile:

function do_cat()
{
 local CAT
 case "$1" in
 *.gz) CAT=zcat;;
 *.bz2) CAT=bzcat;;
 *) CAT=cat;;
 esac
 $(${CAT} "$1")
)

function smart_cat()
{
 local i
 for i in "$@"; do
 do_cat "$i"
 done
}

Very thought-provoking tip! Of course, the do_cat function can be extended to handle other cat-like commands simply by including more entries in the case portion of the do_cat() function. I guess I could have created only a single function of smart_cat(), but I like the separation of using two functions.


John McKown

Correction

In the December 2008 issue of Linux Journal, the “Going MoBile” interview said that Linux Journal's mobile site, m.linuxjournal.com, ran on Linux-based MoFuse. Instead, it runs on Drupal (as does our main site), using a theme optimized for mobile devices.


Doc Searls

Photo of the Month

Have a photo you'd like to share with LJ readers? Send your submission to info@linuxjournal.com. If we run yours in the magazine, we'll send you a free T-shirt.

Logan Bryngelson, submitted by his father, Ryan Bryngelson.