Skip to content

Commit 93309fb

Browse files
nmdefrieskrivard
andauthored
use canonical var expansion in awk
Co-authored-by: Katie Mazaitis <krivard@cs.cmu.edu>
1 parent 83938a9 commit 93309fb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

facebook/micro/monthly-archive.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ perform_rollup_and_post ()
1414
BATCH="cd $1\nls -1 cvid_responses_${MONTH}*.gz"
1515
sftp -b <(echo -e "${BATCH}") -P 2222 fb-automation@ftp.delphi.cmu.edu 2>/dev/null | \
1616
grep "^cvid" | \
17-
awk -F_ 'BEGIN{print "cd '"$1"'"} {key=$3 $4 $5; if (key!=last && last!="") {print record} last=key; record=$0} END{print record}' | \
17+
awk -F_ -vDIR="$1" 'BEGIN{print "cd " DIR} {key=$3 $4 $5; if (key!=last && last!="") {print record} last=key; record=$0} END{print record}' | \
1818
sed '/^cvid/ s/^/get /' >fetch.sftp
1919
sftp -b fetch.sftp -P 2222 fb-automation@ftp.delphi.cmu.edu
2020
OUT=${MONTH/_/-}

0 commit comments

Comments
 (0)