Industry guru Dave Taylor offers tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.     


The box arrived from NoStarch Press and ...

It's official. Wicked Cool Shell Scripts is a real book. I have a copy in my hands right now, and another twenty or so on my shelf. My kudos to NoStarch Press for a job well done!

Dave's Answer:
Curious about the topic? It's 101 great shell scripts for Unix, Linux and Mac OS X systems, each presented in its entirety with detailed explanations, sample input and output, and suggestions on ways you can hack it to go even further. Scripts range from Apache log file analysis tools to Web site scrapers, Mac OS X account management utilities to a version of the game hangman for your edification.

It's a good book. Check it out!


Related The Writing Business articles:
✔   What's the best option for self-publishing my book?
I have written a book and I want to self-publish, but I am not sure how to choose a self-publishing company. Which self-publishing...
✔   How do I get into online writing?
I really want to get into writing online, Dave. Can you offer up some tips and tricks for me to break into this...
✔   How do I recover a lost ISBN book number?
I self-published a book in 1983. I would now like to make it an e-book. I do not remember my isbn number. How...
✔   How do you avoid writer's block?
I want to get into blogging, but I hear from my friends that it's really hard because after a few weeks you start...
✔   How do I get my first novel published when I'm a kid?
I've been searching for some help on this a for about four, five years. I'm 16 years old and I've been writing novels...

Let's stay in touch!
Sign up for my weekly AskDaveTaylor Newsletter and you'll receive even more tech and gadget help right to your inbox, along with exclusive news and industry updates. It's good stuff. I promise!
    Enter your name: and your email addr:  





Categorized: The Writing Business   (Article 3676, Written by )
Tagged:
Previous: Including Word files on your Web site
Next: Weird Internet Explorer 6 hiccups




Reader Comments To Date: 4

Steve Macdonald said, on March 18, 2004 10:33 AM:

In script #7 under MacOS 10.2.8; I get a cut error:

[home:~/scripts] smac% valid-date november 25 1963
usage: cut -c list [file1 ...]
cut -f list [-s] [-d delim] [file ...]
usage: cut -c list [file1 ...]
cut -f list [-s] [-d delim] [file ...]
usage: cut -c list [file1 ...]
cut -f list [-s] [-d delim] [file ...]
valid-date: Unknown month name 25

It appears that its taking the second field for the month,
rather than the first. It fails on every date entered.

I've verified that normdate works properly:

[home:~/scripts] smac% normdate november 25 1963
Nov 25 1963

... and I freely admit that I'm a clueless puppy trying to learn scripting by doing.

Help? :)

smac

Dave T. said, on March 19, 2004 11:57 PM:

As you reported to me in email, your problem was that you'd copied the cut statements like this:

month="$(echo $newdate | cut -d\ -f1)"
day="$(echo $newdate | cut -d\ -f2)"
year="$(echo $newdate | cut -d\ -f3)"

The problem is that you need TWO spaces after the backslash. Fix that, and it works fine. :-)

Dennis Brunskill said, on April 20, 2004 1:10 PM:

Am very interested in your book after seeing you on the Screen Savers last night (4/19/04). I tried the bestcompress script but it looks like I'm getting incorrect results. I'm running it on a 7767 txt file and it reports compress as the best choice resulting in a compressed file size of 4493. If however I run gzip and bzip2 on the txt file I get file sizes of 3715 and 3559 respectively. So it dosen't appear that compress is the best choice and bestcompress is not comparing the file sizes correctly. ???

Dave Taylor said, on April 25, 2004 11:32 PM:

Thanks for your note, Dennis. You're correct: it turns out that by default the ls command wants to sort filenames alphabetically, which turns out to be a problem with this particular script. The good news is that it's super easy to fix: instead of using "ls -l" in this script use "ls -lf" instead. There's a more detailed explanation on the main page of the booktalk weblog...

Starbucks coffee cup I do have a lot to say, and questions of my own for that matter, but first I'd like to say thank you, Dave, for all your helpful information by buying you a cup of coffee!

I do have a comment, now that you mention it!











I will never send you any unsolicited email. Ever.






Check This Out Too...

 
Look for Answers
Need Help? Ask Dave Taylor!


Follow Me on Pinterest

Find Me on Google+
ADT on G+
© 2002 - 2013 by Dave Taylor. All Rights Reserved.

Note: This web site is for the purpose of disseminating information for educational purposes, free of charge, for the benefit of all visitors. We take great care to provide quality information. However, we do not guarantee, and accept no legal liability whatsoever arising from or connected to, the accuracy, reliability, currency or completeness of any material contained on this web site or on any linked site. Further, please note that by submitting a question or comment you're agreeing to my terms of service, which are: you relinquish any subsequent rights of ownership to your material by submitting it on this site. My lawyer says "Thanks".
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.