NOTICE: This package has been removed from pkgsrc

./wip/pipestatus, UNIX/POSIX shell helper for running pipes safely

[ CVSweb ] [ Homepage ] [ RSS ] [ Required by ]


Branch: CURRENT, Version: 0.6.0, Package name: pipestatus-0.6.0, Maintainer: cheusov

pipestatus - source file for POSIX shell that allows
to obtain an exit status of every program in a pipe.

MOTIVATION

When we program in shell we often run pipes like this

prog1 args1 | prog2 args2 | ... | progN argsN

POSIX says that exit status of pipe is the exit status of LAST program
in it, i.e. progN in our example. That is, exit status of all other
programs in pipe is silently ignored. But in many situations exit
status of all programs in pipe should be checked to make program
robust. Some shells like BASH and ZSH have special extensions for
doing this but POSIX shell unfortunately doesn't provide an EASY way
for doing this.

In order to solve the problem, described above pipestatus was written.


Master sites: (Expand)

SHA1: ea1dfcf05ec421d15ec0c060b0d00a3e4dd59d41
RMD160: 587ca90797dcd67a843bc4bc56ba6cbff2e50d15
Filesize: 6.388 KB

Version history: (Expand)


CVS history: (Expand)


   2010-03-11 00:49:58 by Thomas Klausner | Files touched by this commit (4) | Package removed
Log message:
Remove pipestatus, imported into pkgsrc/devel.

   2010-03-11 00:44:36 by Thomas Klausner | Files touched by this commit (1)
Log message:
Remove unnecessary empty line.

   2009-09-13 10:18:55 by Aleksey Cheusov | Files touched by this commit (2) | Package updated
Log message:

update to version 0.6.0

    Major changes:

    - Symbols "'`*\?&|; etc. are correctly escaped before eval'ed.
      As a result all these symbols are allowed in commands.
      For example,

        # the following command outputs ''??????{}!&| --- ??????{}!&|'''
        runpipe_base \
           awk 'BEGIN {print "+*<>(){}!&|"; exit 41}'  '|' \
           sed 's,[+*<>()],?,g' '|' \
           awk '{print $0 " --- " $0; exit 43}' '|' \
           awk "{print \"''\" \$0 \"'''\"; exit 44}"
        echo "$pipestatus_all" # '41 0 43 44'
        echo "$pipestatus_1"   # '41'
        echo "$pipestatus_2"   # '0'
        echo "$pipestatus_3"   # '43'
        echo "$pipestatus_4"   # '44'
        echo "$pipesize"       # '4'

      Regresion test for this case.

    - Support for shitty Solaris /bin/sh
       $(()) is replaced with expr(1),
       $() -- with ``,
       for i -- with for i in "$@"

    - Makefile: new target "test_all" for testing all available shells
   2009-08-10 22:26:19 by Aleksey Cheusov | Files touched by this commit (1)
Log message:
LICENSE=public-domain

   2008-05-04 23:22:48 by Aleksey Cheusov | Files touched by this commit (2)
Log message:

version -> 0.5.0

  Major changes

    - 'check_status_re' and therefore 'runpipe_re' use 'grep -E'
      instead of 'grep' in order to simplify regexp that
      contains >=2 digit exit statuses.

      NOTE: Formally speaking this breaks backward compatibility.

    - If PIPESTATUS_VERBOSE variable is set to non-empty string, then
      check_status0 and check_status_re functions print an error
      message to stderr.
   2008-03-30 15:20:41 by Aleksey Cheusov | Files touched by this commit (1)
Log message:
DESTDIR support

   2008-01-24 23:15:12 by Aleksey Cheusov | Files touched by this commit (4)
Log message:

pipestatus - source file for POSIX shell that allows
to obtain an exit status of every program in a pipe.

                        MOTIVATION

When we program in shell we often run pipes like this

    prog1 args1 | prog2 args2 | ... | progN argsN

POSIX says that exit status of pipe is the exit status of LAST program
in it, i.e.  progN in our example. That is, exit status of all other
programs in pipe is silently ignored.  But in many situations exit
status of all programs in pipe should be checked to make program
robust. Some shells like BASH and ZSH have special extensions for
doing this but POSIX shell unfortunately doesn't provide an EASY way
for doing this.

In order to solve the problem, described above pipestatus was written.