From: Steven Baltakatei Sandoval Date: Sat, 4 Jul 2020 00:19:54 +0000 (+0000) Subject: style(unitproc):appendArgTar: Simplify command string eval cmd X-Git-Tag: 0.3.0~66 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/766719298015c6a939ef8930753e4fc3cdc9c324?hp=-c style(unitproc):appendArgTar: Simplify command string eval cmd --- 766719298015c6a939ef8930753e4fc3cdc9c324 diff --git a/unitproc/bktemp-appendArgTar b/unitproc/bktemp-appendArgTar index fedd668..e3ecb22 100644 --- a/unitproc/bktemp-appendArgTar +++ b/unitproc/bktemp-appendArgTar @@ -8,7 +8,7 @@ try() { "$@" || die "cannot $*"; } 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.3 + # Version: 1.0.4 # Input: arg1: data to be written # arg2: file name of file to be inserted into tar # arg3: tar archive path (must exist first) @@ -55,7 +55,7 @@ appendArgTar(){ # yell "DEBUG:STATUS:$FN:TMP_DIR:$TMP_DIR" # Write to temporary working dir - eval "$CMD0"" | ""$CMD1"" | ""$CMD2"" | ""$CMD3"" | ""$CMD4" > "$TMP_DIR"/"$FILENAME"; + eval "$CMD0 | $CMD1 | $CMD2 | $CMD3 | $CMD4" > "$TMP_DIR"/"$FILENAME"; # Append to tar try tar --append --directory="$TMP_DIR" --file="$TAR_PATH" "$FILENAME";