HOME  |  GIT Overview  |  Script-Archive: (docs) : (wiki) : (git)  |  ...

Peter's Script-Archive - Shell Functions and Setup


This section is home of shell support functions and shell setup.

ksh93: Note that the korn shell ksh 93s+ suffers from various memory management issues on 64bit incl. eating return codes (possibly restricted to x86_64, Linux and the January08 AST release) for Ubuntu intrepid, jaunty and Centos 5.3. Karmic will be the May09 AST release and has a ksh93t+ that plays nice on 64bit (bzr branch lp:ubuntu/karmic/ksh, there doesn't seem to be a PPA). If you're affected, just place the official standalone ksh binary early in your PATH (if you're evil, you might also consider /bin/ksh93 for replacement). It doesn't require the remainder of the AST stuff: http://www.research.att.com/~gsf/cgi-bin/download.cgi?action=list&name=ksh)

set -o pipefail - Workaround: Some of the scripts in other sections use set -o pipefail and thus require a proper ksh (ksh93!) or bash (e.g. emv, sfre). If you don't mind changing the scripts and efficiency, you can change the invocations to instead source pipestatus, which works for all POSIX shells.

Check that you're using at least the version 0.6, as this release added support for pathological and unsafe filenames containing blanks, quotes and worse (including embedded newlines) as part of filenames. cat | nl thus becomes source PATH-TO-PIPESTATUS; runpipe_base cat '|' nl. I tried breaking Aleksey's changes, only to report to him my utter lack of success - so it's looking good now :). A note on nesting pipes: Define complex commands (like nested runpipe-invocations, pipes, lists) as functions and invoke the functions as simple commands in the pipeline stages of the outer runpipe statement.

Some of the more interesting functions

Git View of this section / Download


HOME  |  GIT Overview  |  Script-Archive: (docs) : (wiki) : (git)  |  ...

jakobi(at)acm.org, 2009-07 - 2012-03