E-Mail:

Ask Dave Taylor

Creating multiple accounts in Thunderbird

At this day and age it’s no surprise that people have more than one email account, but if you’ve been using the Mozilla Thunderbird application, you might well be unsure how to set it up for more than one account. Fortunately, here’s a quick primer on exactly how to accomplish that:
    Create Multiple [...]

Cool Linux command line and shell script tricks!

As the author of a bunch of books on Unix and shell script programming (most recently Teach Yourself Unix in 24 Hours and Wicked Cool Shell Scripts) I see a lot of interesting questions about how to be more efficient with the Unix / Linux command line and how to do neat things in shell [...]

Quick Unix reports with the “awk” program

We live in an age of newer, faster, more sophisticated, but sometimes older software tools can solve a problem neatly and with minimal fuss. So it is with shell script programming and some of the simple but powerful commands included with the Unix / Linux / Mac OS X environment. In fact, I’ve been using [...]

Reading lines of data within a shell script

One of the most common core tasks that people perform with shell scripts is to read data and process it in some manner. Quite often, that’s accomplished by using a pipe or command-line redirection, but sometimes you need to be able to read lines of data within the shell script itself, and it’s not entirely [...]

How do you do date math in Linux?

While modern Linux operating systems have more capabilities than you can shake a bag full of sticks at, there are still some tasks that aren’t as easy as you’d like. One of the most common challenges is date math. What’s the date 37 days from today, or 496 days ago? The question I received [...]

How can I prompt someone for a password within a shell script?

I’m the first to admit that there’s nothing I can’t do with a shell script, be it a graphical web-based interface to a data file or a powerful database query utility or whatever else. Indeed, I have a whole book on the subject: Wicked Cool Shell Scripts. But that’s another story!
A reader query led me [...]

Nifty little Linux shell script to scrape /etc/passwd data

There’s a certain level of fascination with account data on Unix and Linux and I receive a surprising number of queries about how to accomplish different tasks while analyzing that data on one of these systems. It turns out to be really easy, however, if you’re familiar with the awk command in Linux / Unix, [...]

My Unix Background Jobs Have Become Invisible?

Last night I started downloading all of Fedora core via rsync. It was getting late, so I put it in the background and logged out. i just logged in this morning, and wanted to see where it was, so I typed “jobs.” Surprise, it isn’t there. I know it’s still running, because the lights on [...]

Can I connnect my Sony PSP to my Linux system?

I want to transfer music and movies to my Sony PSP, on my computer I’m using Suse Linux 9.2. What kind of program or software can I use? The problem is that my computer can’t find the Sony PSP when I plug it in the USB port.
I dug around and found a couple of interesting [...]

How to get started as a Linux-based computer artist

I’m an artist who is trying to translate my skill with a canvas onto the computer, and I’m a bit baffled by all the options on the market. If I can, I’d like to stick with Linux as my brother is a Linux expert, but I’ve also heard lots of good things about Mac systems [...]

How to turn your Linux system into a DHCP server

I am planning to install DHCP on my Linux Server. I do not know that much in Linux (Red Hat), however. How can I install and configure a DHCP server on my system?
First off, a definition. DHCP is the Dynamic Host Configuration Protocol and rather than use the default DHCP server included with your Red [...]

How do I rotate files in Unix?

On Solaris I have cron job which creates some log files and it puts it under a directory, this directory name is created based on system date for example directory name are like 08162005, 08172005 so on..
What I need is I want to do a rotation for these log directories every 14 days since these [...]

What does “cat -” do?

Hello I would like to know the what exactly does cat - mean in Unix? I was recently reading through an article that mentioned this command and couldn’t understand what it did.
“cat” is the ‘concatenate’ program and its purpose is to display the contents of one or more file. Add the ‘-’ flag, however, [...]

How do I customize a script from “Wicked Cool Shell Scripts”?

Regarding script #41 (calculating available disk space), out of your book Wicked Cool Shell Scripts, I am unclear how I can have this script calculate the free space on one specific drive, namely /Volumes/Documents HD in my case.
I’d also love to know how I can automatically email the results of this same script, say [...]

How do I extract users from /etc/password in a shell script?

I am working on a script where I would like to grab the usernames out of the passwd file for a defined range of UIDs. For example I would like to pull the usernames for all users in /etc/passwd that are in the range of 5000-5999. Can you help?
While this task might initially [...]

How do I re-redirect stdin in a Unix or Linux shell script?

Hi Dave. I’m trying to create a shell script in HP-UX Unix that looks like this:
while read usrname
do
lsh $usrname
done < $file
and in lsh I added some error checks. If one occurs I ask the user to correct their input, but the code didn’t work that way and it continues to [...]

Redirecting input in a unix shell script?

I have several SCO Unix script that read a parameter from user input or otherwise I put the param within my script, such as ftp scripts and so on. How can I read those parameters from a file insted?
Example: I write an ftp script that will connect to a remote location and bring files, right [...]

Slackware Linux screen resolution problem?

I am using Slackware 10.1 GNU/Linux? OS and quite happy with that. Though I am an advance user, I am having a problem with that!
I want to set the screen resolution to 1152 X 864 with 75Hz Monitor VF that works well with dual boot Windows 2000 Pro. Currently Slackware shows, 800 x 600, 1024 [...]

Bootloader configuration for Ubuntu, Yellow Dog Linux and Mac OS X?

Dave, I’m following your setup for installing Ubuntu, Yellowdog, and OSX on a G4. I purchased a new secondary hard drive and have successfully installed OSX, Ubuntu Linux and Yellowdog Linux 4.0.1.
I’ve installed the three OS’s and have reached the step where Yellowdog now takes precedence over ubuntu and Ubuntu is no longer visible [...]

How can I hide passwords in a shell script?

We have to do sudo in a shell/perl scripts for certain commands. As you know sudo needs password to be supplied. sudo has -S option for stdin.
For example:
echo $pw | sudo -S command
Assume, somehow, we figure out the password and pass it in for the above echo. But, the buggest concern is, if [...]

25 queries / 0.225 seconds.