Featured »

March 2, 2022 – 2:00 pm

Books have been written on the subject of awk and sed. Here’s a small sample of commands I put together over the years that are useful for everyday system administration tasks. Most of these tasks …

Read the full story »
Networking

Unix and Linux network configuration. Multiple network interfaces. Bridged NICs. High-availability network configurations.

Applications

Reviews of latest Unix and Linux software. Helpful tips for application support admins. Automating application support.

Data

Disk partitioning, filesystems, directories, and files. Volume management, logical volumes, HA filesystems. Backups and disaster recovery.

Monitoring

Distributed server monitoring. Server performance and capacity planning. Monitoring applications, network status and user activity.

Commands & Shells

Cool Unix shell commands and options. Command-line tools and application. Things every Unix sysadmin needs to know.

Home » Archive by Tags

Articles tagged with: shell script

Shell Scripting for HPC Clusters, Part 2

October 23, 2009 – 12:30 pm
shell

This is the second installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters. You can view the first part of the guide here.
Searching, Replacing, Comparing
Try to work with a large cluster and …

Shell Scripting for HPC Clusters, Part 1

October 10, 2009 – 12:59 am
shell_003

This is the first installment of a multipart guide for beginner Unix sysadmins supporting HPC clusters.
“For” and “While” Loop Constructs
The main challenge of supporting a Linux cluster is ensuring a homogeneous environment. Aside from small …

Shell Random Number Generator

August 4, 2009 – 2:58 pm
shell_001

Sometimes, in the course of writing shell script, a need arises for some random input. Using the built-in $RANDOM shell variable will give you a random number from 0 to 32767 . Let’s take a …

The Follies of Traffic Driving

July 11, 2009 – 4:31 pm
Traffic light for bikes.

Imagine a busy street in the city with sidewalks packed with pedestrians. Hundreds of people are pushing and shoving, eating, arguing, talking on their cell phones and not paying any attention to each other. Suddenly, …

Random Filename Chooser

June 17, 2008 – 9:02 pm
lock code

This is a rather peculiar little script with a purpose that may not be immediately apparent. The script will look for files in the specified folder; it will then pick one at random from the …

Simple network monitoring with ping

April 11, 2006 – 10:12 am
computer_security_it_privacy_0002

In the Spring of 2005 Comcast experienced a major DNS outage. Since then many Comcast users have switched to DNS servers that belong to Verizon and other ISPs. Comcast started taking a lot of flak …

Solaris One-Liners

March 21, 2006 – 12:41 pm
sun_solaris_0001

Useful Solaris commands for system administrators

Generating complex SQL queries with shell scripts

February 21, 2006 – 9:08 am
shell_0004

It is sometimes necessary to use complex select and insert queries with dozens of variables. Writing such queries by hand is a tedious process and the chance of making a mistake is high. A few …

Bounce Veritas HA Cluster resource

December 7, 2005 – 11:01 am
boot

The following is a Korn shell script that can be used from command line or cron to bounce a Veritas HA Cluster resource. This can be useful to resolve certain problems with Oracle databases running …

Handling errors and trapping system calls

December 2, 2005 – 11:20 am
shell_002

In the course of writing a shell script it is important to consider possible error and unexpected interrupts. Let’s say you wrote an interactive script that allows users to archive old files to free up …

Wget examples and scripts

November 27, 2005 – 3:19 pm
dump truck

Wget is a command-line Web browser for Unix and Windows. Wget can download Web pages and files; it can submit form data and follow links; it can mirror entire Web sites and make local copies. …

Find largest files

November 19, 2005 – 11:17 pm
shell

How to find the largest files in the directory tree on Solaris.