fork(14) download
  1. #!/bin/bash
  2.  
  3. t=$(mktemp -t -d) || exit
  4. cd "$t"
  5.  
  6. cat <<'____HERE' >Makefile
  7. SHELL := /bin/bash
  8.  
  9. .PHONY: all
  10. all:
  11. 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 )\
  12. ; for key in "$${!PROVS[@]}" ; do \
  13. touch "foo_$${key}_$${PROVS[$${key}]}" ; \
  14. done
  15. ls -la
  16. ____HERE
  17.  
  18. make --version
  19. make
Success #stdin #stdout 0s 5032KB
stdin
Standard input is empty
stdout
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