From: Steven Baltakatei Sandoval Date: Fri, 3 Jul 2020 19:19:52 +0000 (+0000) Subject: fix(unitproc):appendArgTar:Fix sample code X-Git-Tag: 0.3.0~68 X-Git-Url: https://zdv2.bktei.com/gitweb/BK-2020-03.git/commitdiff_plain/0089d651fea9dd67c3db938617dd4407c8f563bb?ds=sidebyside;hp=-c fix(unitproc):appendArgTar:Fix sample code --- 0089d651fea9dd67c3db938617dd4407c8f563bb diff --git a/unitproc/bktemp-appendArgTar b/unitproc/bktemp-appendArgTar index ee31743..5d42dc2 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.1 + # Version: 1.0.2 # Input: arg1: data to be written # arg2: file name of file to be inserted into tar # arg3: tar archive path (must exist first) @@ -58,10 +58,10 @@ appendArgTar(){ } # Append Bash var to file appended to Tar archive #==BEGIN sample code== -myFile="/tmp/$(date +%s)..original" -echo "how are you doing?" > "$myFile" -myVAR="$(cat "$myFile")" -writeArg "$myVAR" "$myFile..LOUD_CHILD" "tee /tmp/cloneityclone " "tr '[:lower:]' '[:upper:]'" +myTar="/tmp/$(date +%s).tar"; +try tar --create --file="$myTar" --files-from=/dev/null ; +myVar="how are you doing?" +appendArgTar "$myVar" "$(date +%s)..LOUD_insidetar" "$myTar" "/dev/shm" "tee /tmp/$(date +%s)..outsidetar " "tr '[:lower:]' '[:upper:]'" #==END sample code== # Author: Steven Baltakatei Sandoval