修訂 | 40d64c8fcc38f25688bab0c7b3363a56fdefb2a2 (tree) |
---|---|
時間 | 2014-11-19 19:42:20 |
作者 | Lorenzo Isella <lorenzo.isella@gmai...> |
Commiter | Lorenzo Isella |
Simple bash scripts to copy/rename files.
@@ -0,0 +1,123 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | + | |
4 | + | |
5 | +array=("BE" "BG" "CZ" "DK" "DE" "EE" "IE" "EL" "ES" "FR" "IT" "CY" "LV" "LT" "LU" "HU" "MT" "NL" "AT" "PL" "PT" "RO" "SI" "SK" "FI" "SE" "UK" "HR" ) | |
6 | + | |
7 | +array2=("fig1" "fig2" "fig3" "fig4" "fig5" "fig6" "fig7" "fig8" "fig9" "fig10" "fig11" "fig12" "fig13" "fig14" ) | |
8 | + | |
9 | + | |
10 | + | |
11 | +echo "Array items:" | |
12 | +for item in ${array[*]} | |
13 | +do | |
14 | + printf " %s\n" $item | |
15 | + | |
16 | +done | |
17 | + | |
18 | + | |
19 | + | |
20 | + | |
21 | + | |
22 | +# rm $echo "./fig1/*" | |
23 | + | |
24 | + | |
25 | +# rm "./fig2/*" | |
26 | +# rm "./fig3/*" | |
27 | +# rm "./fig4/*" | |
28 | +# rm "./fig5/*" | |
29 | +# rm "./fig6/*" | |
30 | +# rm "./fig7/*" | |
31 | +# rm "./fig8/*" | |
32 | +# rm "./fig9/*" | |
33 | +# rm "./fig10/*" | |
34 | +# rm "./fig11/*" | |
35 | +# rm "./fig12/*" | |
36 | +# rm "./fig13/*" | |
37 | +# rm "./fig14/*" | |
38 | +# rm "./fig15/*" | |
39 | + | |
40 | +for item in ${array2[*]} | |
41 | +do | |
42 | + printf " %s\n" $item | |
43 | + | |
44 | + | |
45 | + rm $item/* | |
46 | + # cp $item*1.png $item | |
47 | + # cp $item*.csv $item | |
48 | + | |
49 | +done | |
50 | + | |
51 | + | |
52 | + | |
53 | + | |
54 | +for item in ${array[*]} | |
55 | +do | |
56 | + ext="_gbaord_and_gerd_pc_gdp*png" | |
57 | + | |
58 | + cp $item/$item$ext "./fig2" | |
59 | + | |
60 | + ext="_gbaord_and_gerd_mio*png" | |
61 | + | |
62 | + cp $item/$item$ext "./fig1" | |
63 | + | |
64 | + | |
65 | + ext="_gbaord_and_gerd_pc_gov*png" | |
66 | + | |
67 | + cp $item/$item$ext "./fig3" | |
68 | + | |
69 | + | |
70 | + ext="_gov_expenditure_pc*png" | |
71 | + | |
72 | + cp $item/$item$ext "./fig5" | |
73 | + | |
74 | + | |
75 | + ext="_gov_expenditure_mio*png" | |
76 | + | |
77 | + cp $item/$item$ext "./fig4" | |
78 | + | |
79 | + | |
80 | + ext="_gdp_growth*png" | |
81 | + | |
82 | + cp $item/$item$ext "./fig6" | |
83 | + | |
84 | + ext="_funding_to_public_by_source_mio*png" | |
85 | + | |
86 | + cp $item/$item$ext "./fig7" | |
87 | + | |
88 | + | |
89 | + ext="_funding_to_public_by_source_perc*png" | |
90 | + | |
91 | + cp $item/$item$ext "./fig8" | |
92 | + | |
93 | + | |
94 | + ext="_gov_funding_public_mio*png" | |
95 | + | |
96 | + cp $item/$item$ext "./fig9" | |
97 | + | |
98 | + ext="_gov_funding_public_pc*png" | |
99 | + | |
100 | + cp $item/$item$ext "./fig10" | |
101 | + | |
102 | + | |
103 | + ext="_gov_funding_by_perf_perc_change.png" | |
104 | + | |
105 | + cp $item/$item$ext "./fig11" | |
106 | + | |
107 | + ext="_RD_abroad*png" | |
108 | + | |
109 | + cp $item/$item$ext "./fig12" | |
110 | + | |
111 | + ext="_abr_gbaord*mio_nac*png" | |
112 | + | |
113 | + cp $item/$item$ext "./fig13" | |
114 | + | |
115 | + ext="_abr_gbaord*pc_gdp*png" | |
116 | + | |
117 | + cp $item/$item$ext "./fig14" | |
118 | + | |
119 | + | |
120 | + | |
121 | + | |
122 | +done | |
123 | + |
@@ -0,0 +1,179 @@ | ||
1 | +#!/bin/bash | |
2 | + | |
3 | + | |
4 | + | |
5 | +array=("BE" "BG" "CZ" "DK" "DE" "EE" "IE" "EL" "ES" "FR" "IT" "CY" "LV" "LT" "LU" "HU" "MT" "NL" "AT" "PL" "PT" "RO" "SI" "SK" "FI" "SE" "UK" "HR" ) | |
6 | + | |
7 | + | |
8 | +# array=( "AT" "BE" "BG" ) | |
9 | + | |
10 | + | |
11 | + | |
12 | +# array2=("fig1" "fig2" "fig3" "fig4" "fig5" "fig6" "fig7" "fig8" "fig9" "fig10" "fig11" "fig12" "fig13" "fig14" ) | |
13 | + | |
14 | + | |
15 | + | |
16 | +echo "Array items:" | |
17 | +for item in ${array[*]} | |
18 | +do | |
19 | + printf " %s\n" $item | |
20 | + | |
21 | +done | |
22 | + | |
23 | + | |
24 | + | |
25 | +for item in ${array[*]} | |
26 | +do | |
27 | + ext="_gbaord_and_gerd_pc_gdp*png" | |
28 | + | |
29 | + ext2="b.png" | |
30 | + | |
31 | + mv $item/$item$ext $item/$item$ext2 | |
32 | + | |
33 | + | |
34 | + | |
35 | + | |
36 | + | |
37 | + ext="_gbaord_and_gerd_mio*png" | |
38 | + ext2="a.png" | |
39 | + | |
40 | + | |
41 | + mv $item/$item$ext $item/$item$ext2 | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
46 | + | |
47 | + | |
48 | + ext="_gbaord_and_gerd_pc_gov*png" | |
49 | + ext2="c.png" | |
50 | + | |
51 | + mv $item/$item$ext $item/$item$ext2 | |
52 | + | |
53 | + | |
54 | + | |
55 | + | |
56 | + | |
57 | + | |
58 | + ext="_gov_expenditure_pc*png" | |
59 | + ext2="e.png" | |
60 | + | |
61 | + | |
62 | + mv $item/$item$ext $item/$item$ext2 | |
63 | + | |
64 | + | |
65 | + | |
66 | + | |
67 | + | |
68 | + | |
69 | + ext="_gov_expenditure_mio*png" | |
70 | + ext2="d.png" | |
71 | + | |
72 | + | |
73 | + | |
74 | + mv $item/$item$ext $item/$item$ext2 | |
75 | + | |
76 | + | |
77 | + | |
78 | + | |
79 | + | |
80 | + | |
81 | + | |
82 | + ext="_gdp_growth*png" | |
83 | + ext2="f.png" | |
84 | + | |
85 | + mv $item/$item$ext $item/$item$ext2 | |
86 | + | |
87 | + | |
88 | + | |
89 | + | |
90 | + ext="_funding_to_public_by_source_mio*png" | |
91 | + ext2="g.png" | |
92 | + | |
93 | + | |
94 | + | |
95 | + mv $item/$item$ext $item/$item$ext2 | |
96 | + | |
97 | + | |
98 | + | |
99 | + | |
100 | + ext="_funding_to_public_by_source_perc*png" | |
101 | + ext2="h.png" | |
102 | + | |
103 | + | |
104 | + mv $item/$item$ext $item/$item$ext2 | |
105 | + | |
106 | + | |
107 | + | |
108 | + | |
109 | + | |
110 | + ext="_gov_funding_public_mio*png" | |
111 | + ext2="i.png" | |
112 | + | |
113 | + mv $item/$item$ext $item/$item$ext2 | |
114 | + | |
115 | + | |
116 | + | |
117 | + | |
118 | + | |
119 | + ext="_gov_funding_public_pc*png" | |
120 | + ext2="l.png" | |
121 | + | |
122 | + | |
123 | + | |
124 | + mv $item/$item$ext $item/$item$ext2 | |
125 | + | |
126 | + | |
127 | + | |
128 | + | |
129 | + | |
130 | + | |
131 | + | |
132 | + | |
133 | + | |
134 | + ext="_gov_funding_by_perf_perc_change.png" | |
135 | + ext2="m.png" | |
136 | + | |
137 | + mv $item/$item$ext $item/$item$ext2 | |
138 | + | |
139 | + | |
140 | + | |
141 | + | |
142 | + | |
143 | + | |
144 | + ext="_RD_abroad*png" | |
145 | + ext2="n.png" | |
146 | + | |
147 | + mv $item/$item$ext $item/$item$ext2 | |
148 | + | |
149 | + | |
150 | + | |
151 | + | |
152 | + | |
153 | + | |
154 | + ext="_abr_gbaord*mio_nac*png" | |
155 | + ext2="o.png" | |
156 | + | |
157 | + | |
158 | + mv $item/$item$ext $item/$item$ext2 | |
159 | + | |
160 | + | |
161 | + | |
162 | + | |
163 | + | |
164 | + | |
165 | + | |
166 | + ext="_abr_gbaord*pc_gdp*png" | |
167 | + ext2="p.png" | |
168 | + | |
169 | + | |
170 | + | |
171 | + mv $item/$item$ext $item/$item$ext2 | |
172 | + | |
173 | + | |
174 | + | |
175 | + | |
176 | +done | |
177 | + | |
178 | + | |
179 | + |