12
Unix Philosophy

Unix Philosophy

Embed Size (px)

Citation preview

Unix Philosophy

•Small is beautiful.•Make each program do one thing well.•Build a prototype as soon as possible.•Choose portability over efficiency.•Store numerical data in flat ASCII files.•Use software leverage to your advantage.•Use shells scripts to increase leverage and portability.•Avoid captive user interfaces.•Make every program a filter.

Small is beautiful.Small things can be combined in many ways to create useful large things.

Leader/00-23 *****nam##22*****#a#4500 001 <control number> 003 <control number identifier> 005 19920331092212.7 007/00-01 ta 008/00-39 820305s1991####nyu###########001#0#eng## 020 ##$a0845348116 :$c$29.95 (£19.50 U.K.) 020 ##$a0845348205 (pbk.) 040 ##$a[organization code]$c[organization code] 050 14$aPN1992.8.S4$bT47 1991 082 04$a791.45/75/0973$219 100 1#$aTerrace, Vincent,$d1948- 245 10$aFifty years of television :$ba guide to series and pilots, 1937-1988 /$cVincent Terrace. 246 1#$a50 years of television 260 ##$aNew York :$bCornwall Books,$cc1991. 300 ##$a864 p. ;$c24 cm. 500 ##$aIncludes index. 650 #0$aTelevision pilot programs$zUnited States$vCatalogs. 650 #0$aTelevision serials$zUnited States$vCatalogs.

Make each program do one thing well.

Build a prototype as soon as possible.

Choose portability over efficiency.

Store numerical data in flat ASCII files.

Use software leverage to your advantage.

Running Symphony on a virtual serverMaking electronic resources count using LDAPAdvanced UNIX tips/tricksCustomizing E-Library 3.3 and beyondSymphony Reports for a lean, mean collectionEDI/9XXImplementing Credit Card PaymentsEnterprise unraveledIntegrating Web 2.0 applications with the OPACImplementing SchoolRoomsShortcuts for inventorying your collectionCataloging serials without the serials moduleCreating custom reports using APIUsing Director's StationUNIX for the UninitiatedPatron Notification via Text MessagingUsing Selection Lists with AcquisitionsTips, tricks, and troubleshooting for APIAuthority ControlImplementing PortfolioWeb Reporter in PracticeHow Other Libraries Have Implemented Bookmyne and/or Webservices

Use shell scripts to increase leverage and portability.

$ vi first## My first shell script#clearecho "Knowledge is Power"

#!/bin/bash

# Backs up all files in current directory modified within last 24 hours #+ in a "tarball" (tarred and gzipped file).

BACKUPFILE=backup-$(date +%m-%d-%Y) # Embeds date in backup filename. # Thanks, Joshua Tschida, for the idea. archive=${1:-$BACKUPFILE} # If no backup-archive filename specified on command-line, #+ it will default to "backup-MM-DD-YYYY.tar.gz."

tar cvf - `find . -mtime -1 -type f -print` > $archive.tar gzip $archive.tar echo "Directory $PWD backed up in archive file \"$archive.tar.gz\"."

# Stephane Chazelas points out that the above code will fail #+ if there are too many files found #+ or if any filenames contain blank characters.

# He suggests the following alternatives: # ------------------------------------------------------------------- # find . -mtime -1 -type f -print0 | xargs -0 tar rvf "$archive.tar" # using the GNU version of "find".

# find . -mtime -1 -type f -exec tar rvf "$archive.tar" '{}' \; # portable to other UNIX flavors, but much slower. # -------------------------------------------------------------------

exit 0

Avoid captive user interfaces.

Make every program a filter.

Charge UserDB

ItemDB

Charge DB

Lissa PotterAdministrative Office of the U.S. [email protected]