Everybody knows that Unix shell utilities are powerful. Even though they’re text-based, you can build a lot of useful things outside of the text domain. Today I’ll show you how to implement set operations. All we need are sorted files as input, with each file representing a set.
Archive for the 'shell' Category
Quick Tip #2: Set Operations Using Shell Tools
August 19, 2009Rsync Snapshot Backups Revisited
August 9, 2008A while ago, I blogged about my self-made backup solution, a simple shell script using rsync to create snapshot backups. This wasn’t my first attempt at establishing backups for my private workstation but the most successful one so far. The backup takes less than 5 minutes for about 10 GB of data in my home [...]
Quick Tip #1: Implicit FIFOs in Bash
July 5, 2008One could assume that I have run out of material and retreat to safer ground, but far from it. From now on I’ll just throw in a few quick shell hacks hoping some of you don’t know them yet. So, here it goes …
Unix pipes are cool, but it’s quite a limitation that a program [...]
Parsing Command Line Options in Shell Scripts
August 5, 2007In programs written in C, parsing of command line arguments has always been done using the getopt(3) library function. This function has set the standards Linux/Unix users have come to expect from command line interfaces. Fortunately, there’s a getopt(3) equivalent for almost every programming language and the shell is no exception.
Building RPMs Without Root Access
March 25, 2007This week at work I had the opportunity to build an RPM for some third-party software package.
My previous experiences with RPM date back to SuSE 5 almost ten years ago and I haven’t touched it ever since. Packaging for Debian or even NetBSD is mostly a painless process, so I hoped today’s RPM wouldn’t be [...]
Changing Directories Quickly
February 11, 2007When you work with the interactive shell, there’s a common pattern that is used a lot: Copying or moving files to a directory and then changing to the target directory using cd. In these cases, you find yourself typing the name twice:
$ cp file1 file2 file3 /very/long/path/name
$ cd /very/long/path/name
Tab completion helps, [...]
Using D-Bus Introspection
December 19, 2006To control a D-Bus-enabled application, you need the interface definition to find out which methods are offered and which parameters they expect.
Of course, you can get the relevant interface definition from the application’s source distribution. But there’s an easier way: Ask the object in question via D-Bus to give you the interface description. All objects [...]