Skip to content

Commit

Permalink
fixed gawk FS to have regex to always split at '/./'
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuaboud committed Nov 12, 2019
1 parent a510e71 commit a2ab592
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions s3wrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ BUCKET=$1 # first argument is s3 bucket
shift

for ARG in "$@"; do
REL=$(echo $ARG | awk -F '/./' '{print $2}')
REL=$(echo "$ARG" | gawk -F '[/][.][/]' '{print $2}')
# echo "s3cmd put $ARG s3://"$BUCKET"/"$REL""
s3cmd put $ARG s3://"$BUCKET"/"$REL"
s3cmd put "$ARG" s3://"$BUCKET"/"$REL"
done

exit 0

0 comments on commit a2ab592

Please sign in to comment.