1 | shell_patterns=0 |
---|
2 | + t r & ! t t |
---|
3 | ^ Edit file |
---|
4 | e %f |
---|
5 | |
---|
6 | + t t |
---|
7 | ^ Edit files |
---|
8 | e %u |
---|
9 | |
---|
10 | + ! t t |
---|
11 | @ Do something on the current file |
---|
12 | CMD=%{Enter command} |
---|
13 | $CMD %f |
---|
14 | |
---|
15 | + t t |
---|
16 | @ Do something on the tagged files |
---|
17 | set %t; CMD=%{Enter command} |
---|
18 | set -x |
---|
19 | while [ -n "$1" ]; do |
---|
20 | $CMD "$1" || echo tag "$1" >>$MC_CONTROL_FILE |
---|
21 | shift |
---|
22 | done |
---|
23 | |
---|
24 | = t d |
---|
25 | 3 Make a release of the current subdirectory (tar.gz) |
---|
26 | Pwd=`basename %d /` |
---|
27 | echo -n "Name of the distribution file (without extension) [$Pwd]: " |
---|
28 | read tar |
---|
29 | if [ "$tar"x = x ]; then tar=$Pwd; fi |
---|
30 | cd .. && tar chf - $Pwd | gzip -f9 > $tar.tar.gz |
---|
31 | echo ../${tar}.tar.gz created. |
---|
32 | # tar=%{Name of the distribution file (without extension)} |
---|
33 | |
---|
34 | 4 Make a release of the current subdirectory (tar.bz2) |
---|
35 | Pwd=`basename %d /` |
---|
36 | echo -n "Name of the distribution file (without extension) [$Pwd]: " |
---|
37 | read tar |
---|
38 | if [ "$tar"x = x ]; then tar=$Pwd; fi |
---|
39 | cd .. && tar chf - $Pwd | bzip2 -f > $tar.tar.bz2 |
---|
40 | echo ../${tar}.tar.bz2 created. |
---|
41 | # tar=%{Name of the distribution file (without extension)} |
---|
42 | |
---|
43 | = f \.(c|cpp|cc|C)$ & t r |
---|
44 | + f \.(c|cpp|cc|C)$ & t r & ! t t |
---|
45 | m Compile and link current c/c++ file |
---|
46 | fil=%f; trg=${fil##*/}; trg=${trg%%.c}; trg=${trg%%.cpp}; trg=${trg%%.cc}; trg=${trg%%.C} |
---|
47 | if make -n $trg >/dev/null 2>&1; then |
---|
48 | make $trg |
---|
49 | else |
---|
50 | g++ -O2 -march=$(uname -m) -g -o $trg $fil |
---|
51 | fi |
---|
52 | |
---|
53 | + t r & ! t t |
---|
54 | a Append file to opposite |
---|
55 | cat %f >>%D/%f |
---|
56 | |
---|
57 | + t t |
---|
58 | A Append files to opposite files |
---|
59 | set %u |
---|
60 | while [ -n "$1" ]; do |
---|
61 | cat $1 >>%D/$1 || echo tag $1 >>$MC_CONTROL_FILE |
---|
62 | shift |
---|
63 | done |
---|
64 | |
---|
65 | + t r & ! t t |
---|
66 | d Delete file if a copy exists in the other directory. |
---|
67 | if [ "%d" = "%D" ]; then |
---|
68 | echo "The two directores must be different" |
---|
69 | exit 1 |
---|
70 | fi |
---|
71 | if [ -f %D/%f ]; then # if two of them, then |
---|
72 | if cmp -s %D/%f %f; then |
---|
73 | rm %f && echo %f: DELETED |
---|
74 | else |
---|
75 | echo "%f and %D/%f differ: NOT deleted" |
---|
76 | echo -n "Press RETURN " |
---|
77 | read key |
---|
78 | fi |
---|
79 | else |
---|
80 | echo %f: No copy in %D/%f: NOT deleted. |
---|
81 | fi |
---|
82 | |
---|
83 | + t t |
---|
84 | D Delete tagged files if a copy exists in the other directory. |
---|
85 | if [ "%d" = "%D" ]; then |
---|
86 | echo "The two directores must be different" |
---|
87 | exit 1 |
---|
88 | fi |
---|
89 | for i in %t |
---|
90 | do |
---|
91 | if [ -f %D/$i ]; then |
---|
92 | SUM1="`sum $i`" |
---|
93 | SUM2="`sum %D/$i`" |
---|
94 | if [ "$SUM1" = "$SUM2" ]; then |
---|
95 | rm $i && echo ${i}: DELETED |
---|
96 | else |
---|
97 | echo $i and %D/$i differ: NOT deleted. |
---|
98 | fi |
---|
99 | else |
---|
100 | echo %f has no copy in %D/%f: NOT deleted. |
---|
101 | fi |
---|
102 | done |
---|
103 | |
---|
104 | + ! t t |
---|
105 | c Copy file to remote host (no error checking) |
---|
106 | scp %f %{Target host:dir} |
---|
107 | |
---|
108 | + t t |
---|
109 | c Copy files to remote host (no error checking) |
---|
110 | scp -r %u %{Target host:dir} |
---|
111 | |
---|
112 | = f \.tex$ & t r |
---|
113 | + f \.tex$ & t r & ! t t |
---|
114 | t Run latex on file and show it with xdvi |
---|
115 | latex %f && xdvi `basename %f .tex`.dvi |
---|
116 | |
---|
117 | =+ f \.tar\.gz$ | f \.tar\.z$ | f \.tgz$ | f \.tpz$ | f \.tar\.Z$| f \.tar\.bz2$ & t r |
---|
118 | x Extract the contents of a compressed tar file |
---|
119 | unset EXT |
---|
120 | echo %f|egrep -q "\.tar.bz2$" && EXT=tar_bz2 |
---|
121 | if [ "$EXT" = "tar_bz2" ]; then |
---|
122 | bunzip2 -c %f | tar xvf - |
---|
123 | else |
---|
124 | gzip -dc %f | tar xvf - |
---|
125 | fi |
---|
126 | |
---|
127 | = t r |
---|
128 | + ! t t |
---|
129 | y Gzip or gunzip current file |
---|
130 | unset DECOMP |
---|
131 | echo %f|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d |
---|
132 | gzip $DECOMP -v %f |
---|
133 | |
---|
134 | + t t |
---|
135 | Y Gzip or gunzip tagged files |
---|
136 | for i in %t |
---|
137 | do |
---|
138 | unset DECOMP |
---|
139 | echo $i|egrep -q "\.gz$|\.z$|\.Z$" && DECOMP=-d |
---|
140 | gzip $DECOMP -v $i |
---|
141 | done |
---|
142 | |
---|
143 | + ! t t |
---|
144 | b Bzip2 or bunzip2 current file |
---|
145 | unset DECOMP |
---|
146 | echo %f|egrep -q "\.bz2$" && DECOMP=-d |
---|
147 | bzip2 $DECOMP -v %f |
---|
148 | |
---|
149 | + t t |
---|
150 | B Bzip2 or bunzip2 tagged files |
---|
151 | for i in %t |
---|
152 | do |
---|
153 | unset DECOMP |
---|
154 | echo $i|egrep -q "\.bz2$" && DECOMP=-d |
---|
155 | bzip2 $DECOMP -v $i |
---|
156 | done |
---|
157 | |
---|
158 | + f \.tar.gz$ | f \.tgz$ | f \.tpz$ | f \.tar.Z$ | f \.tar.z$ | f \.tar.bz2$ & t r & ! t t |
---|
159 | z Extract compressed tar file to subdirectory |
---|
160 | unset D |
---|
161 | echo %f|egrep -q "\.tar.gz$" && EXT=tar_gz |
---|
162 | echo %f|egrep -q "\.tgz$" && EXT=tgz |
---|
163 | echo %f|egrep -q "\.tpz$" && EXT=tpz |
---|
164 | echo %f|egrep -q "\.tar.Z$" && EXT=tar_Z |
---|
165 | echo %f|egrep -q "\.tar.z$" && EXT=tar_z |
---|
166 | echo %f|egrep -q "\.tar.bz2$" && EXT=tar_bz2 |
---|
167 | case $EXT in |
---|
168 | tar_gz) D="`basename %f .tar.gz`";; |
---|
169 | tgz) D="`basename %f .tgz`";; |
---|
170 | tpz) D="`basename %f .tpz`";; |
---|
171 | tar_Z) D="`basename %f .tar.Z`";; |
---|
172 | tar_z) D="`basename %f .tar.z`";; |
---|
173 | tar_bz2) D="`basename %f .tar.bz2`";; |
---|
174 | esac |
---|
175 | if [ "$EXT" = "tar_bz2" ]; then |
---|
176 | mkdir $D; cd $D && (bunzip2 -c ../%f | tar xvf -) |
---|
177 | else |
---|
178 | mkdir $D; cd $D && (gzip -dc ../%f | tar xvf -) |
---|
179 | fi |
---|
180 | |
---|
181 | + f \.tar.F$ & t r & ! t t |
---|
182 | z Extract compressed tar file to subdirectory |
---|
183 | unset D |
---|
184 | echo %f|egrep -q "\.tar.F$" && EXT=tar_F |
---|
185 | case $EXT in |
---|
186 | tar_F) D="`basename %f .tar.F`";; |
---|
187 | esac |
---|
188 | mkdir $D; cd $D && (freeze -dc ../%f | tar xvf -) |
---|
189 | |
---|
190 | + t t |
---|
191 | Z Extract compressed tar files to subdirectories |
---|
192 | set %u |
---|
193 | while [ -n "$1" ] |
---|
194 | do |
---|
195 | unset D |
---|
196 | echo $1|egrep -q "\.tar.gz$" && EXT=tar_gz |
---|
197 | echo $1|egrep -q "\.tgz$" && EXT=tgz |
---|
198 | echo $1|egrep -q "\.tpz$" && EXT=tpz |
---|
199 | echo $1|egrep -q "\.tar.Z$" && EXT=tar_Z |
---|
200 | echo $1|egrep -q "\.tar.z$" && EXT=tar_z |
---|
201 | echo $1|egrep -q "\.tar.F$" && EXT=tar_F |
---|
202 | echo $1|egrep -q "\.tar.bz2$" && EXT=tar_bz2 |
---|
203 | case $EXT in |
---|
204 | tar_gz) D="`basename $1 .tar.gz`";; |
---|
205 | tgz) D="`basename $1 .tgz`";; |
---|
206 | tpz) D="`basename $1 .tpz`";; |
---|
207 | tar_Z) D="`basename $1 .tar.Z`";; |
---|
208 | tar_z) D="`basename $1 .tar.z`";; |
---|
209 | tar_F) D="`basename $1 .tar.F`";; |
---|
210 | tar_bz2) D="`basename $1 .tar.bz2`";; |
---|
211 | esac |
---|
212 | case $EXT in |
---|
213 | tar_gz|tgz|tpz|tar_Z|tar_z) mkdir $D; (cd $D && gzip -dc ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE;; |
---|
214 | tar_F) mkdir $D; (cd $D && freeze -dc ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE;; |
---|
215 | tar_bz2) mkdir $D; (cd $D && bunzip2 -c ../$1 | tar xvf -)||echo tag $1 >>$MC_CONTROL_FILE |
---|
216 | esac |
---|
217 | shift |
---|
218 | done |
---|
219 | |
---|
220 | + f \.gz$ | f \.tgz$ | f \.tpz$ | f \.Z$ | f \.z$ | f \.bz2$ & t r & ! t t |
---|
221 | c Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 |
---|
222 | unset D |
---|
223 | echo %f|egrep -q "\.tgz$" && EXT=tgz |
---|
224 | echo %f|egrep -q "\.tpz$" && EXT=tpz |
---|
225 | echo %f|egrep -q "\.Z$" && EXT=Z |
---|
226 | echo %f|egrep -q "\.z$" && EXT=z |
---|
227 | echo %f|egrep -q "\.gz$" && EXT=gz |
---|
228 | echo %f|egrep -q "\.bz2$" && EXT=bz2 |
---|
229 | case $EXT in |
---|
230 | tgz) D="`basename %f .tgz`.tar";; |
---|
231 | tpz) D="`basename %f .tpz`.tar";; |
---|
232 | gz) D="`basename %f .gz`";; |
---|
233 | bz2) D="`basename %f .bz2`";; |
---|
234 | esac |
---|
235 | if [ "$EXT" = "bz2" ]; then |
---|
236 | bunzip2 -v %f ; gzip -f9 -v $D |
---|
237 | else |
---|
238 | gunzip -v %f ; bzip2 -v $D |
---|
239 | fi |
---|
240 | |
---|
241 | + t t |
---|
242 | C Convert gz<->bz2, tar.gz<->tar.bz2 & tgz->tar.bz2 |
---|
243 | set %u |
---|
244 | while [ -n "$1" ] |
---|
245 | do |
---|
246 | unset D |
---|
247 | echo %f|egrep -q "\.tgz$" && EXT=tgz |
---|
248 | echo %f|egrep -q "\.tpz$" && EXT=tpz |
---|
249 | echo %f|egrep -q "\.Z$" && EXT=Z |
---|
250 | echo %f|egrep -q "\.z$" && EXT=z |
---|
251 | echo %f|egrep -q "\.gz$" && EXT=gz |
---|
252 | echo %f|egrep -q "\.bz2$" && EXT=bz2 |
---|
253 | case $EXT in |
---|
254 | tgz) D="`basename $1 .tgz`.tar";; |
---|
255 | tpz) D="`basename $1 .tpz`.tar";; |
---|
256 | gz) D="`basename $1 .gz`";; |
---|
257 | bz2) D="`basename $1 .bz2`";; |
---|
258 | esac |
---|
259 | if [ "$EXT" = "bz2" ]; then |
---|
260 | (bunzip2 -v $1 ; gzip -f9 -v $D)||echo tag $1 >>$MC_CONTROL_FILE |
---|
261 | else |
---|
262 | (gunzip -v $1 ; bzip2 -v $D)||echo tag $1 >>$MC_CONTROL_FILE |
---|
263 | fi |
---|
264 | shift |
---|
265 | done |
---|
266 | |
---|
267 | + x /usr/bin/open | x /usr/local/bin/open & x /bin/sh |
---|
268 | o Open next a free console |
---|
269 | open -s -- sh |
---|
270 | |
---|
271 | u umount hdb |
---|
272 | umount /dev/hdb2 |
---|
273 | umount /dev/hdb3 |
---|
274 | sudo hdparm -y /dev/hdb |
---|
275 | |
---|
276 | + f \.wav$ & ! t t |
---|
277 | M Make mp3 |
---|
278 | mp3 mp3 %f |
---|
279 | |
---|
280 | + t t |
---|
281 | M Make mp3s |
---|
282 | mp3 mp3 %u |
---|
283 | |
---|
284 | + f \.wav$ & ! t t |
---|
285 | O Make ogg |
---|
286 | ogg ogg %f |
---|
287 | |
---|
288 | + t t |
---|
289 | O Make oggs |
---|
290 | ogg ogg %u |
---|
291 | |
---|
292 | + f \.(ogg|mp3)$ & ! t t |
---|
293 | r Recode ogg/mp3 to ogg |
---|
294 | ogg recode %f |
---|
295 | |
---|
296 | + f ^\.\.$ & ! t t |
---|
297 | r Recode oggs/mp3s in this dir to ogg |
---|
298 | ls *.mp3 *.ogg 2>/dev/null | sed "s/\([ \"']\)/\\\\\1/g" | xargs -r ogg recode |
---|
299 | |
---|
300 | + t t |
---|
301 | r Recode tagged oggs/mp3s to ogg |
---|
302 | ogg recode %u |
---|
303 | |
---|
304 | + f \.(ogg|mp3)$ & ! t t |
---|
305 | p Play ogg/mp3 |
---|
306 | mp3 play %f |
---|
307 | |
---|
308 | + f ^\.\.$ & ! t t |
---|
309 | p Play oggs/mp3s in this dir |
---|
310 | mp3 play |
---|
311 | |
---|
312 | + t t |
---|
313 | p Play tagged oggs/mp3s |
---|
314 | mp3 play %u |
---|
315 | |
---|
316 | + f ^\.\.$ & ! t t |
---|
317 | P Play oggs/mp3s in this dir in random order |
---|
318 | mp3 rplay |
---|
319 | |
---|
320 | + t t |
---|
321 | P Play tagged in random order oggs/mp3s |
---|
322 | mp3 rplay %u |
---|
323 | |
---|
324 | + f \.(ogg|mp3)$ & ! t t |
---|
325 | e Play ogg/mp3 (queue) |
---|
326 | mp3 play -e %f |
---|
327 | |
---|
328 | + f ^\.\.$ & ! t t |
---|
329 | e Play oggs/mp3s in this dir (queue) |
---|
330 | mp3 play -e |
---|
331 | |
---|
332 | + t t |
---|
333 | e Play tagged oggs/mp3s (queue) |
---|
334 | mp3 play -e %u |
---|
335 | |
---|
336 | + f ^\.\.$ & ! t t |
---|
337 | E Play oggs/mp3s in this dir in random order (queue) |
---|
338 | mp3 rplay -e |
---|
339 | |
---|
340 | + t t |
---|
341 | E Play tagged in random order oggs/mp3s (queue) |
---|
342 | mp3 rplay -e %u |
---|
343 | |
---|
344 | + f \.(ogg|mp3)$ & ! t t |
---|
345 | t Retag ogg/mp3 |
---|
346 | mp3 retag %f |
---|
347 | |
---|
348 | + f ^\.\.$ & ! t t |
---|
349 | t Retag oggs/mp3s in this dir |
---|
350 | ls *.mp3 *.ogg 2>/dev/null | sed "s/\([ \"']\)/\\\\\1/g" | xargs -r mp3 retag |
---|
351 | |
---|
352 | + t t |
---|
353 | t Retag tagged oggs/mp3s |
---|
354 | mp3 retag %u |
---|
355 | |
---|
356 | + t t |
---|
357 | B cvs admin -kb on tagged files |
---|
358 | cvs admin -kb %u |
---|
359 | |
---|
360 | + t t |
---|
361 | N cvs admin -ko on tagged files |
---|
362 | cvs admin -ko %u |
---|
363 | |
---|
364 | + ! t t |
---|
365 | B cvs admin -kb on file |
---|
366 | cvs admin -kb %f |
---|
367 | |
---|
368 | + ! t t |
---|
369 | N cvs admin -ko on file |
---|
370 | cvs admin -ko %f |
---|