lib/scripts/ucat
changeset 2579 4af1023fc6bf
parent 2347 a42c1b835fb3
child 3007 e5efa177ee0c
equal deleted inserted replaced
2578:cc768a16ef65 2579:4af1023fc6bf
     1 #!/bin/bash -norc
     1 #!/bin/bash -norc
     2 #
     2 #
     3 # $Id$
     3 # $Id$
     4 #
     4 #
     5 # ucat - uninterruptible cat.
     5 # ucat - uninterruptible cat.
     6 #
       
     7 # NOTE: If perl is unavailable we simply fall back on normal cat!
       
     8 
     6 
     9 
     7 exec tee -i /dev/null "$@"
    10 PERL=$(type -path perl)
       
    11 
       
    12 if [ -z "$PERL" ]
       
    13 then
       
    14   exec cat "$@"
       
    15 else
       
    16   exec $PERL -e '$SIG{INT} = "IGNORE"; $| = 1; while (<ARGV>) {print;}' "$@"
       
    17 fi