json-schema-validator/test/test-pipe-in.sh
2018-03-30 12:26:52 +02:00

14 lines
213 B
Bash
Executable File

#!/bin/bash
# all argument are considered as a program to call (with its arguments),
# the last argument is read from via '<'
set -e
arr=( "$@" )
input=${arr[-1]}
unset 'arr[${#arr[@]}-1]'
${arr[@]} < $input