/usr/bin/pfsinmulti is in pfstools 1.8.5-1ubuntu3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 | #!/bin/bash
############################################################
# Read several streams of frames and write pfs streams to
# named pipes.
############################################################
if test -z "$1" || test "$1" = "--help"; then
cat <<EOF
Read several sequences of frames or images and write them
as pfs streams to named pipes.
Usage: pfsinmulti <file> [<file>...] -- <command> @1 [@2 [..]]
See the man page for more information.
EOF
exit 1
fi
all_named_pipes=""
do_break="0"
while test "$1"; do
if test "${1:0:1}" = "-"; then
global_arguments="$global_arguments $1"
shift
continue
fi
file_pattern="$1"
# Get --frames and --skip-frames arguments
extra_arguments="";
if test -n "$2"; then
if test "$2" = "--"; then
shift
do_break="1"
else
while test "${2:0:1}" = "-"; do
if test "$2" = "--frames"; then
if test -z "$3"; then
echo >&2 "Required argument missing after --frames"
exit 1;
fi
extra_arguments="$extra_arguments $2 $3"
shift
else
extra_arguments="$extra_arguments $2"
fi
shift
done
fi
fi
named_pipe=`mktemp`
rm -f $named_pipe
mkfifo $named_pipe
pfsin $global_arguments "$file_pattern" $extra_arguments >$named_pipe &
all_named_pipes="$all_named_pipes $named_pipe"
shift
if test "$do_break" = "1"; then
break
fi
done
command=$*
new_command=`echo -e "FILES=${all_named_pipes}\nCMD=${command}" | awk '/^FILES/ { for( i=2; i <= NF; i++ ) FILE[i-1]=$i;} /^CMD/ { gsub( "CMD=", "" ); for( i in FILE ) { PAT="@" i; subsc=gsub( PAT, FILE[i] ); if( subsc<1 ) { print( "ERROR" ); exit( 1 );} } print $0;}'`
if test "$new_command" = "ERROR"; then
echo "pfsinmulti error: You must specify as many @1, @2, .., @n arguments in the command string as there are pfs streams" 1>&2
#remove named pipes
cat $all_named_pipes >/dev/null
rm -f $all_named_pipes
exit 1
fi
if ! ${new_command}; then
echo "pfsinmulti error: command returned error" 1>&2
# cat $all_named_pipes >/dev/null
rm -f $all_named_pipes
exit 1
fi
rm -f $all_named_pipes
|