#!/bin/bash t=$(mktemp -t -d) || exit cd "$t" cat <<'____HERE' >Makefile SHELL := /bin/bash .PHONY: all all: declare -A PROVS=( ["NL"]=10 ["PE"]=11 ["NS"]=12 ["NB"]=13 ["QC"]=24 ["ON"]=35 ["MB"]=46 ["SK"]=47 ["AB"]=48 ["BC"]=59 ["YK"]=60 ["NT"]=61 ["NU"]=62 )\ ; for key in "$${!PROVS[@]}" ; do \ touch "foo_$${key}_$${PROVS[$${key}]}" ; \ done ls -la ____HERE make --version make
Standard input is empty
GNU Make 4.0
Built for i586-pc-linux-gnu
Copyright (C) 1988-2013 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://g...content-available-to-author-only...u.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
declare -A PROVS=( ["NL"]=10 ["PE"]=11 ["NS"]=12 ["NB"]=13 ["QC"]=24 ["ON"]=35 ["MB"]=46 ["SK"]=47 ["AB"]=48 ["BC"]=59 ["YK"]=60 ["NT"]=61 ["NU"]=62 )\
; for key in "${!PROVS[@]}" ; do \
touch "foo_${key}_${PROVS[${key}]}" ; \
done
ls -la
total 4
drwx------ 2 20033 20033 320 Sep 28 04:29 .
drwxrwx--- 3 root 20033 60 Sep 28 04:29 ..
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_AB_48
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_BC_59
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_MB_46
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_NB_13
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_NL_10
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_NS_12
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_NT_61
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_NU_62
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_ON_35
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_PE_11
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_QC_24
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_SK_47
-rw-rw-r-- 1 20033 20033 0 Sep 28 04:29 foo_YK_60
-rw-rw-r-- 1 20033 20033 286 Sep 28 04:29 Makefile