#! /bin/bash if [[ "$1" == "" ]] then cat >&2 <&1 "Argument must contain slash: $1" status=1 return fi if [[ "$DIR" == "" || "$FILE" == "" ]] then echo 2>&1 "Both file and directory must be non-null: $1" status=1 return fi # Do the work. ( echo $FILE svn propget svn:ignore $DIR ) | sed -e '/^$/d' | sort -u | tee /dev/fd/3 | svn propset svn:ignore -F /dev/stdin $DIR } # Set fd 3 to stdout. exec 3>&1 status=0 for F in "$@" do process_file "$F" done