Created
June 26, 2018 21:04
-
-
Save fabiomontefuscolo/3a9b673dce790dfaca45e956147545be to your computer and use it in GitHub Desktop.
savestdin.sh
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
function show_usage() { | |
echo "$1 [CAT_OPTIONS] filename" | |
} | |
if [ "${#}" -lt 1 ]; | |
then | |
show_usage "$0"; | |
exit -1; | |
fi | |
args="${@:1:$#-1}" | |
filename="${@:$#}" | |
set -- | |
for arg in "${args[@]}"; | |
do | |
set -- "$@" "$arg"; | |
done | |
cat $@ > $filename |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment