appendArgTar(){
# Desc: Writes first argument to temporary file with arguments as options, then appends file to tar
# Usage: appendArgTar "$(echo "Data to be written.")" [name of file to be inserted] [tar path] [temp dir] ([cmd1] [cmd2] [cmd3] [cmd4]...)
- # Version: 1.0.5
+ # Version: 1.0.6
# Input: arg1: data to be written
# arg2: file name of file to be inserted into tar
# arg3: tar archive path (must exist first)
if ! [ -z "$4" ]; then tmpDir="$4"; else yell "ERROR:$fn:No temporary working dir set."; exit 1; fi
# Set command strings
- if ! [ -z "$5" ]; then cmd1="$5"; else cmd1="tee /dev/null "; fi # command string 1
- if ! [ -z "$6" ]; then cmd2="$6"; else cmd2="tee /dev/null "; fi # command string 2
- if ! [ -z "$7" ]; then cmd3="$7"; else cmd3="tee /dev/null "; fi # command string 3
- if ! [ -z "$8" ]; then cmd4="$8"; else cmd4="tee /dev/null "; fi # command string 4
+ if ! [ -z "$5" ]; then cmd1="$5"; else cmd1="cat "; fi # command string 1
+ if ! [ -z "$6" ]; then cmd2="$6"; else cmd2="cat "; fi # command string 2
+ if ! [ -z "$7" ]; then cmd3="$7"; else cmd3="cat "; fi # command string 3
+ if ! [ -z "$8" ]; then cmd4="$8"; else cmd4="cat "; fi # command string 4
# Input command
cmd0="echo \"\$1\""