Skip to content

Commit b0e923e

Browse files
committed
remove positional arg remapping
since monthly-archive.sh doesn't use positional arguments. The $3, etc are actually local to awk (e.g. positional word by line).
1 parent 5fd9083 commit b0e923e

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

facebook/micro/monthly-archive.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,12 @@ fi
99
echo ${MONTH}
1010
R_MONTH=${MONTH#*_}; R_MONTH=${R_MONTH#0}
1111

12-
# Save script's arguments to reference by name in perform_rollup_and_post() so the script's
13-
# positional arguments and perform_rollup_and_post's positional arguments don't get confusing.
14-
arg0=$0
15-
arg3=$3
16-
arg4=$4
17-
arg5=$5
18-
1912
perform_rollup_and_post ()
2013
{
2114
BATCH="cd $1\nls -1 cvid_responses_${MONTH}*.gz"
2215
sftp -b <(echo -e "${BATCH}") -P 2222 fb-automation@ftp.delphi.cmu.edu 2>/dev/null | \
2316
grep "^cvid" | \
24-
awk -F_ 'BEGIN{print "cd $1"} {key=$arg3 $arg4 $arg5; if (key!=last && last!="") {print record} last=key; record=$arg0} END{print record}' | \
17+
awk -F_ 'BEGIN{print "cd $1"} {key=$3 $4 $5; if (key!=last && last!="") {print record} last=key; record=$0} END{print record}' | \
2518
sed '/^cvid/ s/^/get /' >fetch.sftp
2619
sftp -b fetch.sftp -P 2222 fb-automation@ftp.delphi.cmu.edu
2720
OUT=${MONTH/_/-}

0 commit comments

Comments
 (0)