-
Notifications
You must be signed in to change notification settings - Fork 0
/
atom.xml
1727 lines (1488 loc) · 94.8 KB
/
atom.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<title><![CDATA[Succw Blog :)]]></title>
<subtitle><![CDATA[运成功者的谦词,命失败者的借口。]]></subtitle>
<link href="/atom.xml" rel="self"/>
<link href="http://www.succw.com/"/>
<updated>2014-03-14T04:04:54.856Z</updated>
<id>http://www.succw.com/</id>
<author>
<name><![CDATA[獨菰、瑉]]></name>
<email><![CDATA[[email protected]]]></email>
</author>
<generator uri="http://zespia.tw/hexo/">Hexo</generator>
<entry>
<title><![CDATA[Windows Server 2003下安装PHP (+mssql2000)]]></title>
<link href="http://www.succw.com/windows-server-2003%E4%B8%8B%E5%AE%89%E8%A3%85php/"/>
<id>http://www.succw.com/windows-server-2003下安装php/</id>
<published>2014-03-12T12:26:20.000Z</published>
<updated>2014-03-14T04:04:22.000Z</updated>
<content type="html"><![CDATA[<h5 id="windows-server-2003-php-mssql2000-">Windows Server 2003下安装PHP (+mssql2000)</h5>
<ul>
<li>IIS6</li>
<li><a href="http://windows.php.net/downloads/releases/php-5.2.17-nts-Win32-VC6-x86.zip" target="_blank">PHP 5.2.17</a></li>
<li><a href="http://www.iis.net/downloads/microsoft/fastcgi-for-iis" target="_blank">FastCGI</a></li>
<li>MSSQL 2000</li>
</ul>
<h5 id="-">注意各种配置文件的权限</h5>
<pre><code>(php.ini,fcgiext.ini,php5目录等)
</code></pre><p>Windows PHP 各个版本:
<a href="http://windows.php.net/downloads/releases/" target="_blank">http://windows.php.net/downloads/releases/</a></p>
<p>FastCGI相关文件和路径 :</p>
<ul>
<li>C:\WINDOWS\system32\inetsrv\fcgiext.dll</li>
<li>C:\WINDOWS\system32\inetsrv\fcgiext.ini</li>
</ul>
<h6 id="-php-ini">更改php.ini</h6>
<figure class="highlight sh"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre>PHP开启支持FastCGI
cgi<span class="preprocessor">.force</span>_redirect = <span class="number">0</span>
cgi<span class="preprocessor">.fix</span>_pathinfo = <span class="number">1</span>
fastcgi<span class="preprocessor">.impersonate</span>=<span class="number">1</span>
</pre></td></tr></table></figure>
<h6 id="php-ini-">php.ini通用设置:</h6>
<figure class="highlight sh"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
</pre></td><td class="code"><pre><span class="constant">short_open_tag</span> = On
<span class="constant">error_reporting</span> = E_ALL & ~E_NOTICE
<span class="constant">post_max_size</span> = 16M
<span class="constant">extension_dir</span> = "c:\php5\ext"
<span class="constant">upload_tmp_dir</span> = "D:\php_upload" 上传的临时目录,自己建立目录,权限设定为:Administrators(完全控制)、System(完全控制)、IIS_WPG(读取和写入和删除)、ISUR_你的机器名(读取和写入和删除)
<span class="constant">upload_max_filesize</span> = 20M
<span class="constant">max_file_uploads</span> = 40
<span class="constant">extension</span>=php_bz2.dll
<span class="constant">extension</span>=php_curl.dll
<span class="constant">extension</span>=php_gd2.dll
<span class="constant">extension</span>=php_mbstring.dll
<span class="constant">extension</span>=php_mcrypt.dll
<span class="constant">extension</span>=php_mssql.dll #开启支持mssql
<span class="constant">extension</span>=php_mysql.dll
<span class="constant">extension</span>=php_mysqli.dll
<span class="constant">extension</span>=php_zip.dll
date.timezone = Asia/Shanghai
session.save_path = "D:\php_session"
</pre></td></tr></table></figure>
<h6 id="-fcgiext-ini">更改fcgiext.ini</h6>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre>FastCGI开启支持php [ 追加下代码: ]
[Types]
php=[PHP]
ExePath=c:\php5\php-cgi.exe
<span class="preprocessor">#InstanceMaxRequests=10000</span>
<span class="preprocessor">#ActivityTimeout=600</span>
<span class="preprocessor">#RequestTimeout=600</span>
<span class="preprocessor">#EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000,PHPRC:C:\php5\</span>
</pre></td></tr></table></figure>
<h6 id="iis6-">IIS6配置相关:</h6>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>右键 -> 属性 -> 主目录 -> 配置 -> 添加 ->可执行文件写上:
<span class="constant">C</span><span class="symbol">:/WINDOWS/system32/inetsrv/fcgiext</span>.dll,扩展名写上:.php,动作限制为:<span class="constant">GET</span>,<span class="constant">HEAD</span>,<span class="constant">POST</span>,<span class="constant">TRACE</span>
</pre></td></tr></table></figure>
<p>测试你的配置环境:</p>
<figure class="highlight php"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre><span class="preprocessor"><?php</span>
phpinfo();
<span class="preprocessor">?></span>
</pre></td></tr></table></figure>
<h5 id="php-5-4-26-mssql-2000-">php 5.4.26 + mssql 2000 方式与上有所不同。</h5>
<p>官方在5.3之前提供mssql驱动。之后则需要第三方驱动。</p>
<p><strong>微软官方 (sqlsrv_):</strong>
<a href="http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP" target="_blank">http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP</a></p>
<p><strong> FreeTDS (php_dblib.dll )</strong>
详细安装下链接:
<a href="http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP" target="_blank">http://docs.moodle.org/20/en/Installing_MSSQL_for_PHP</a></p>
<p><strong> php</strong>
google上还找到了一个php提供php5.4.26驱动:
链接在此:<a href="http://downloads.php.net/pierre/sqlsrv-5.4-nts-snap.zip" target="_blank">http://downloads.php.net/pierre/sqlsrv-5.4-nts-snap.zip</a></p>
<hr>
<p>参考链接:</p>
<h6 id="connect-php-with-mssql-while-using-iis">connect php with mssql while using iis</h6>
<p><a href="http://stackoverflow.com/questions/13859282/connect-php-with-mssql-while-using-iis" target="_blank">http://stackoverflow.com/questions/13859282/connect-php-with-mssql-while-using-iis</a>
<a href="http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP" target="_blank">http://docs.moodle.org/20/en/Using_the_Microsoft_SQL_Server_Driver_for_PHP</a></p>
<h6 id="windows-php-">windows php编译配置:</h6>
<p><a href="https://wiki.php.net/internals/windows/stepbystepbuild" target="_blank">https://wiki.php.net/internals/windows/stepbystepbuild</a></p>
]]></content>
<category term="php" scheme="http://www.succw.com/tags/php/"/>
</entry>
<entry>
<title><![CDATA[KVM虚拟化技术笔记]]></title>
<link href="http://www.succw.com/kvm%E8%99%9A%E6%8B%9F%E5%8C%96%E6%8A%80%E6%9C%AF%E7%AC%94%E8%AE%B0/"/>
<id>http://www.succw.com/kvm虚拟化技术笔记/</id>
<published>2014-02-21T03:33:08.000Z</published>
<updated>2014-02-21T03:51:10.000Z</updated>
<content type="html"><![CDATA[<h5 id="kvm-">KVM虚拟化技术笔记</h5>
<p>记录《KVM虚拟化技术:实战与原理解析》书中相关知识点。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>taskset
cpu亲和力设置。
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre>查看kvm是否开启内存硬件技术
cat /sys/<span class="class"><span class="keyword">module</span>/<span class="title">kvm_intel</span>/<span class="title">parameters</span>/<span class="title">ept</span></span>
cat /sys/<span class="class"><span class="keyword">module</span>/<span class="title">kvm_intel</span>/<span class="title">parameters</span>/<span class="title">vpid</span></span>
modprobe kvm_intel ept=<span class="number">0</span>,vpid=<span class="number">0</span>
rmmod kvm_intel
modprobe kvm_inter ept=<span class="number">1</span>,vpid=<span class="number">1</span>
不要关闭,否则内存访问性能会下降
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre>内存HUGEPAGE配置
getconf PAGESIZE
cat /proc/meminfo<span class="subst">|</span>grep Hugepagesize
mount <span class="attribute">-t</span> hugetlbfs hugetlbfs /dev/hugepages
sysctl vm<span class="built_in">.</span>nr_hugepages<span class="subst">=</span>num
qemu<span class="attribute">-system</span><span class="attribute">-x86_64</span> <span class="attribute">-m</span> <span class="number">1024</span> <span class="attribute">-smp</span> <span class="number">2</span> fedora<span class="built_in">.</span>img <span class="attribute">-mem</span><span class="attribute">-path</span> /dev/hugepages
对于内存密集性内存来说,使用hugepage会带来性能提升。
hugepage缺点,内存不能被swap out,也不能使用ballooning。
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>qemu<span class="attribute">-system</span><span class="attribute">-x86_64</span> <span class="attribute">-m</span> <span class="number">1024</span> fedora<span class="built_in">.</span>img <span class="attribute">-enable</span><span class="attribute">-kvm</span> <span class="attribute">-vnc</span> :<span class="number">1</span>,password <span class="attribute">-monitor</span> stdio
修改vnc密码
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>vncviewer <span class="attribute">-listen</span> :<span class="number">2</span>
qemu<span class="attribute">-system</span><span class="attribute">-x86_64</span> <span class="attribute">-m</span> <span class="number">1024</span> fedora<span class="built_in">.</span>img <span class="attribute">-enable</span><span class="attribute">-kvm</span> <span class="attribute">-vnc</span> <span class="number">192.168</span><span class="number">.0</span><span class="number">.2</span>:<span class="number">5500</span>,reverse
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre>vnc鼠标偏移问题
<span class="attribute">-usb</span> <span class="attribute">-usbdevice</span> tablet
<span class="literal">or</span>
<span class="attribute">-device</span> piix3<span class="attribute">-usb</span><span class="attribute">-uhci</span> <span class="attribute">-device</span> usb<span class="attribute">-tablet</span>
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre>Redhat文档介绍,单纯使用virtio_net驱动得到的性能依然不佳,可以检查宿主机系统中对GSO和TSO特性的设置,关闭GSO和TSO可以使性能更加优化
ethtool <span class="attribute">-K</span> em1 gso off
ethtool <span class="attribute">-K</span> em1 tso off
ethtool <span class="attribute">-k</span> em1
</pre></td></tr></table></figure>
<p>vhost_net后端处理程序(内核空间)</p>
<p><code>-net tap,[,vnet_hdr=on|off][,vhost=on|off][,vhostfd=h][,vhostforce=on|off]</code></p>
<p>查看硬盘UUID</p>
<p><code>blkid /dev/vda1</code></p>
<p>or</p>
<p><code>tune2fs -l /dev/vda1</code></p>
<p>在修改磁盘驱动时,可能会导致swap失效。</p>
<p>kvm-clock : <code>-cpu host</code></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>IOMMU,如果内核默认没有打开。
在kernel行,inter_iommu=<span class="command"><span class="keyword">on</span></span>
</pre></td></tr></table></figure>
<h6 id="-cgroup-">通过cgroup控制客户机的资源使用</h6>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre>yum install libcgroup*
mkdir -p /cgroup/blkio
mount -t cgroup -o blkio blkio /cgroup/blkio
mkdir /cgroup/blkio/high_prio
mkdir /cgroup/blkio/low_prio
mount -t cgroup -o cpu,cpuset,memorycpu_mem /cgroup/cpu_mem
echo <span class="variable">$pid</span> >> <span class="regexp">/cgroup/blkio</span><span class="regexp">/high_prio/tasks</span>
echo <span class="variable">$pid</span> >> <span class="regexp">/cgroup/blkio</span><span class="regexp">/low_prio/tasks</span>
echo <span class="number">1000</span> > <span class="regexp">/cgroup/blkio</span><span class="regexp">/high_prio/blkio</span>.weight
echo <span class="number">100</span> > <span class="regexp">/cgroup/blkio</span><span class="regexp">/low_prio/blkio</span>.weight
</pre></td></tr></table></figure>
]]></content>
<category term="KVM" scheme="http://www.succw.com/tags/KVM/"/>
</entry>
<entry>
<title><![CDATA[libvirt编译安装]]></title>
<link href="http://www.succw.com/libvirt%E7%BC%96%E8%AF%91%E5%AE%89%E8%A3%85/"/>
<id>http://www.succw.com/libvirt编译安装/</id>
<published>2014-02-21T03:29:52.000Z</published>
<updated>2014-02-24T07:51:00.000Z</updated>
<content type="html"><![CDATA[<h5 id="-libvirt">编译安装libvirt</h5>
<p>具体操作见官方文档:</p>
<p><strong>安装环境Fedora18 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre>wget http:<span class="comment">//libvirt.org/sources/libvirt-1.2.1.tar.gz</span>
tar xvf libvirt<span class="subst">-</span><span class="number">1.2</span><span class="number">.1</span><span class="built_in">.</span>tar<span class="built_in">.</span>gz
cd libvirt<span class="subst">-</span><span class="number">1.2</span><span class="number">.1</span>
<span class="built_in">.</span>/autogen<span class="built_in">.</span>sh <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-storage</span><span class="attribute">-gluster</span> <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-storage</span><span class="attribute">-rbd</span> <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-gnutls</span> <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-ssh2</span> <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-glusterfs</span> <span class="subst">--</span><span class="keyword">with</span><span class="attribute">-numactl</span>
make
make install
</pre></td></tr></table></figure>
<p>记录下我编译时所需安装包。</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>yum install yajl<span class="attribute">-deve</span> autoconf automake libtool xz<span class="attribute">-devel</span> libxml2<span class="attribute">-devel</span> systemd<span class="attribute">-devel</span> libsepol<span class="attribute">-devel</span> libselinux<span class="attribute">-devel</span> device<span class="attribute">-mapper</span><span class="attribute">-devel</span> libpciaccess<span class="attribute">-devel</span> libnl<span class="attribute">-devel</span>
yum install glusterfs<span class="attribute">-api</span><span class="attribute">-devel</span> glusterfs<span class="attribute">-api</span> glusterfs<span class="attribute">-devel</span> gnutls<span class="attribute">-devel</span> numactl<span class="attribute">-devel</span> libssh2<span class="attribute">-devel</span>
</pre></td></tr></table></figure>
<p>[root@localhost ~]# libvirtd --version
libvirtd (libvirt) 1.2.1</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>
启动libvirtd程序
</pre></td></tr></table></figure>
<p>[root@localhost ~]# /usr/local/sbin/libvirt -d -l</p>
<p>```</p>
]]></content>
<category term="KVM" scheme="http://www.succw.com/tags/KVM/"/>
</entry>
<entry>
<title><![CDATA[ubuntu下安装subversion客户端]]></title>
<link href="http://www.succw.com/svn/"/>
<id>http://www.succw.com/svn/</id>
<published>2014-01-26T11:18:19.000Z</published>
<updated>2014-02-21T03:49:56.000Z</updated>
<content type="html"><![CDATA[<h5 id="ubuntu-subversion-">ubuntu下安装subversion客户端:</h5>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
</pre></td><td class="code"><pre>sudo apt<span class="attribute">-get</span> install subversion subversion<span class="attribute">-tools</span>
</pre></td></tr></table></figure>
<p>详细请看<a href="http://www.subversion.org.cn/svnbook/1.1/index.html" target="_blank"> <a href="http://www.subversion.org.cn/svnbook/1.1/index.html">http://www.subversion.org.cn/svnbook/1.1/index.html</a></a> svn子命令</p>
<p>1、<strong>检出</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre><span class="comment">svn</span> <span class="comment">co</span> <span class="comment">http://路径(目录或文件的全路径) </span><span class="title">[</span><span class="comment">本地目录全路径</span><span class="title">]</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">username</span> <span class="comment">用户名</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">password</span> <span class="comment">密码</span>
<span class="comment">svn</span> <span class="comment">co</span> <span class="comment">svn://路径(目录或文件的全路径) </span><span class="title">[</span><span class="comment">本地目录全路径</span><span class="title">]</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">username</span> <span class="comment">用户名</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">password</span> <span class="comment">密码</span>
<span class="comment">svn</span> <span class="comment">checkout</span> <span class="comment">http://路径(目录或文件的全路径) </span><span class="title">[</span><span class="comment">本地目录全路径</span><span class="title">]</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">username 用户名</span>
<span class="comment">svn</span> <span class="comment">checkout</span> <span class="comment">svn://路径(目录或文件的全路径) </span><span class="title">[</span><span class="comment">本地目录全路径</span><span class="title">]</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">username 用户名</span>
</pre></td></tr></table></figure>
<p><em>注:如果不带--password 参数传输密码的话,会提示输入密码,建议不要用明文的--password 选项
。其中 username 与 password前是两个短线,不是一个。不指定本地目录全路径,则检出到当前目
录下</em>。</p>
<p>例子:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre>svn co svn://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/测试工具 /home/testtools <span class="comment">--username wzhnsc</span>
svn co <span class="keyword">http</span>://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/test/testapp <span class="comment">--username wzhnsc</span>
svn checkout svn://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/测试工具 /home/testtools <span class="comment">--username wzhnsc</span>
svn checkouthttp://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/test/testapp <span class="comment">--username wzhnsc</span>
</pre></td></tr></table></figure>
<p><strong>2、导出(导出一个干净的不带.svn文件夹的目录树)</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre>svn <span class="keyword">export</span> [-r 版本号] http:<span class="comment">//路径(目录或文件的全路径) [本地目录全路径] --username 用户名</span>
svn <span class="keyword">export</span> [-r 版本号] svn:<span class="comment">//路径(目录或文件的全路径) [本地目录全路径] --username 用户名</span>
svn <span class="keyword">export</span> 本地检出的(即带有.svn文件夹的)目录全路径 要导出的本地目录全路径
</pre></td></tr></table></figure>
<p><em>注:第一种从版本库导出干净工作目录树的形式是指定URL,如果指定了修订版本号,会导出相应的
版本,如果没有指定修订版本,则会导出最新的,导出到指定位置。如果省略 本地目录全路径,URL
的最后一部分会作为本地目录的名字。第二种形式是指定 本地检出的目录全路径 到 要导出的本地目
录全路径,所有的本地修改将会保留,但是不在版本控制下(即没提交的新文件,因为.svn文件夹里没
有与之相关的信息记录)的文件不会拷贝。</em></p>
<p>例子:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre>svn exportsvn:<span class="comment">//192.168.0.3/测试工具 /home/testtools --username wzhnsc</span>
svn exporthttp:<span class="comment">//192.168.0.3/test/testapp --username wzhnsc</span>
svn <span class="keyword">export</span>/home/testapp /home/testtools
</pre></td></tr></table></figure>
<p>3、<strong>添加新文件 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre>svn <span class="keyword">add</span> 文件名
*注:告诉SVN服务器要添加文件了,还要用svn commint -m真实的上传上去!
例子:*
svn <span class="keyword">add</span> test<span class="preprocessor">.php</span> <- 添加test<span class="preprocessor">.php</span>
svn commit -m “添加我的测试用test<span class="preprocessor">.php</span>“ test<span class="preprocessor">.php</span>
svn <span class="keyword">add</span> *<span class="preprocessor">.php</span> <- 添加当前目录下所有的php文件
svn commit -m “添加我的测试用全部php文件“ *<span class="preprocessor">.php</span>
</pre></td></tr></table></figure>
<p><strong>4、提交</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre>svn <span class="operator"><span class="keyword">commit</span> -m “提交备注信息文本“ [-N] [--<span class="keyword">no</span>-unlock] 文件名
svn ci -m “提交备注信息文本“ [-N] [--<span class="keyword">no</span>-unlock] 文件名
<span class="string">`必须带上-m参数,参数可以为空,但是必须写上-m`</span>
例子:
svn <span class="keyword">commit</span> -m “提交当前目录下的全部在版本控制下的文件“ * <- 注意这个*表示全部文件
svn <span class="keyword">commit</span> -m “提交我的测试用test.php“ test.php
svn <span class="keyword">commit</span> -m “提交我的测试用test.php“ -N --<span class="keyword">no</span>-unlock test.php <- 保持锁就用–<span class="keyword">no</span>-unlock开关
svn ci -m “提交当前目录下的全部在版本控制下的文件“ * <- 注意这个*表示全部文件
svn ci -m “提交我的测试用test.php“ test.php
svn ci -m “提交我的测试用test.php“ -N --<span class="keyword">no</span>-unlock test.php <- 保持锁就用–<span class="keyword">no</span>-unlock开关</span>
</pre></td></tr></table></figure>
<p><strong>5、更新文件</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre>svn <span class="operator"><span class="keyword">update</span>
svn <span class="keyword">update</span> -r 修正版本 文件名
svn <span class="keyword">update</span> 文件名
例子:
svn <span class="keyword">update</span> <- 后面没有目录,默认将当前目录以及子目录下的所有文件都更新到最新版本
svn <span class="keyword">update</span> -r <span class="number">200</span> test.cpp <- 将版本库中的文件 test.cpp 还原到修正版本(revision)<span class="number">200</span>
svn <span class="keyword">update</span> test.php <- 更新与版本库同步。</span>
</pre></td></tr></table></figure>
<p><em>
提交的时候提示过期冲突,需要先 update 修改文件,</em>
然后清除svn resolved,最后再提交commit。</p>
<p><strong>6、删除文件</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre>svn <span class="keyword">delete</span> svn:<span class="comment">//路径(目录或文件的全路径) -m “删除备注信息文本”</span>
推荐如下操作:
svn <span class="keyword">delete</span> 文件名
svn ci -m “删除备注信息文本”
例子:
svn <span class="keyword">delete</span> svn:<span class="comment">//192.168.1.1/testapp/test.php -m “删除测试文件test.php”</span>
推荐如下操作:
svn <span class="keyword">delete</span> test.php
svn ci -m “删除测试文件test.php”
</pre></td></tr></table></figure>
<p><strong>7、加锁/解锁 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre>svn lock -m “加锁备注信息文本“ [--force] 文件名
svn unlock 文件名
例子:
svn lock -m “锁信测试用test<span class="preprocessor">.php</span>文件“ test<span class="preprocessor">.php</span>
svn unlock test<span class="preprocessor">.php</span>
</pre></td></tr></table></figure>
<p><strong>8、比较差异 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>svn diff 文件名
svn diff <span class="attribute">-r</span> 修正版本号m:修正版本号n 文件名
</pre></td></tr></table></figure>
<p>例子:
svn diff test.php<- 将修改的文件与基础版本比较
svn diff -r 200:201 test.php<- 对 修正版本号200 和 修正版本号201 比较差异</p>
<p><strong>9、查看文件或者目录状态</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre>svn st 目录路径<span class="subst">/</span>名
svn status 目录路径<span class="subst">/</span>名<- 目录下的文件和子目录的状态,正常状态不显示
svn <span class="attribute">-v</span> 目录路径<span class="subst">/</span>名
svn status <span class="attribute">-v</span> 目录路径<span class="subst">/</span>名<- 显示文件和子目录状态
</pre></td></tr></table></figure>
<p><em>
注:svn status、svn diff和 svn revert这三条命令在没有网络的情况下也可以执行的,原因是svn在本地的.svn中保留了本地版本的原始拷贝
</em></p>
<p><strong>10、查看日志</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre>svn <span class="keyword">log</span> 文件名
例子:
svn <span class="keyword">log</span> test.php<- 显示这个文件的所有修改记录,及其版本号的变化
</pre></td></tr></table></figure>
<p><strong>11、查看文件详细信息</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
</pre></td><td class="code"><pre><span class="title">svn</span> <span class="built_in">info</span> 文件名
例子:
svn <span class="built_in">info</span> test.php
</pre></td></tr></table></figure>
<p><strong>12、SVN 帮助</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
</pre></td><td class="code"><pre>svn <span class="built_in">help</span> <- 全部功能选项
svn <span class="built_in">help</span> ci <- 具体功能的说明
</pre></td></tr></table></figure>
<p><strong>13、查看版本库下的文件和目录列表 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre>svn <span class="keyword">list</span> svn:<span class="comment">//路径(目录或文件的全路径)</span>
svn ls svn:<span class="comment">//路径(目录或文件的全路径)</span>
例子:
svn <span class="keyword">list</span> svn:<span class="comment">//192.168.0.3/test</span>
svn ls svn:<span class="comment">//192.168.0.3/test <- 显示svn://192.168.0.3/test目录下的所有属于版本库的文件和目录</span>
</pre></td></tr></table></figure>
<p><strong>14、创建纳入版本控制下的新目录</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
</pre></td><td class="code"><pre>svn mkdir 目录名
svn mkdir -m <span class="string">"新增目录备注文本"</span> <span class="keyword">http</span>://目录全路径
例子:
svn mkdir newdir
<span class="keyword">http</span>://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/test/newdir
注:添加完子目录后,一定要回到根目录更新一下,不然在该目录下提交文件会提示“提交失败”
svn update
注:如果手工在checkout出来的目录里创建了一个新文件夹newsubdir,再用svn mkdir newsubdir命
令后,SVN会提示:
svn: 尝试用 “svn <span class="built_in">add</span>”或 “svn <span class="built_in">add</span> <span class="comment">--non-recursive”代替?</span>
svn: 无法创建目录“hello”: 文件已经存在此时,用如下命令解决:
svn <span class="built_in">add</span> <span class="comment">--non-recursive newsubdir</span>
在进入这个newsubdir文件夹,用ls -<span class="operator">a</span>查看它下面的全部目录与文件,会发现多了:.svn目录再用 svn
mkdir -m <span class="string">"添hello功能模块文件"</span> svn://<span class="number">192.168</span><span class="number">.0</span><span class="number">.3</span>/test/newdir/newsubdir 命令,
SVN提示:
svn: File already exists: filesystem <span class="string">'/data/svnroot/test/db'</span>, transaction <span class="string">'4541-1'</span>,path <span class="string">'/newdir/newsubdir '</span>
</pre></td></tr></table></figure>
<p><strong>15、恢复本地修改 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre><span class="comment">svn revert </span><span class="title">[</span><span class="literal">-</span><span class="literal">-</span><span class="comment">recursive</span><span class="title">]</span><span class="comment"> 文件名</span>
<span class="comment">注意:</span> <span class="comment">本子命令不会存取网络,并且会解除冲突的状况。但是它不会恢复被删除的目录。</span>
<span class="comment">例子:</span>
<span class="comment">svn</span> <span class="comment">revert</span> <span class="comment">foo</span><span class="string">.</span><span class="comment">c</span> <span class="comment"><-</span> <span class="comment">丢弃对一个文件的修改</span>
<span class="comment">svn</span> <span class="comment">revert</span> <span class="literal">-</span><span class="literal">-</span><span class="comment">recursive</span> <span class="string">.</span> <span class="comment"><-恢复一整个目录的文件,</span><span class="string">.</span> <span class="comment">为当前目录</span>
</pre></td></tr></table></figure>
<p><strong>16、把工作拷贝更新到别的URL </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre>svn <span class="keyword">switch</span> http:<span class="comment">//目录全路径 本地目录全路径</span>
例子:
svn <span class="keyword">switch</span> http:<span class="comment">//192.163.0.3/test/456 . <- (原为123的分支)当前所在目录分支到192.163.0.3/test/456</span>
</pre></td></tr></table></figure>
<p><strong>17、解决冲突 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre>svn resolved [本地目录全路径]
例子:
$ svn <span class="operator"><span class="keyword">update</span>
C foo.c
Updated <span class="keyword">to</span> revision <span class="number">31.</span></span>
</pre></td></tr></table></figure>
<p>如果你在更新时得到冲突,你的工作拷贝会产生三个新的文件:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre>$ ls
foo<span class="preprocessor">.c</span>
foo<span class="preprocessor">.c</span><span class="preprocessor">.mine</span>
foo<span class="preprocessor">.c</span><span class="preprocessor">.r</span>30
foo<span class="preprocessor">.c</span><span class="preprocessor">.r</span>31
</pre></td></tr></table></figure>
<p>当你解决了foo.c的冲突,并且准备提交,运行svn resolved让你的工作拷贝知道你已经完成了所有事情。
你可以仅仅删除冲突的文件并且提交,但是svn resolved除了删除冲突文件,还修正了一些记录在工作拷贝管理区域的记录数据,所以我们推荐你使用这个命令。</p>
<p><strong>18、不checkout而查看输出特定文件或URL的内容 </strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre>svn cat http:<span class="comment">//文件全路径</span>
例子:
svn cat http:<span class="comment">//192.168.0.3/test/readme.txt</span>
</pre></td></tr></table></figure>
]]></content>
<category term="SVN" scheme="http://www.succw.com/tags/SVN/"/>
</entry>
<entry>
<title><![CDATA[SHELL脚本编程大全笔记]]></title>
<link href="http://www.succw.com/shell%E8%84%9A%E6%9C%AC%E7%BC%96%E7%A8%8B%E5%A4%A7%E5%85%A8%E7%AC%94%E8%AE%B0/"/>
<id>http://www.succw.com/shell脚本编程大全笔记/</id>
<published>2014-01-23T11:15:18.000Z</published>
<updated>2014-01-23T11:33:45.000Z</updated>
<content type="html"><![CDATA[<h6 id="shell-">SHELL脚本编程大全笔记</h6>
<hr>
<ul>
<li>A=$[ $1 * $2 ] 直接运算。</li>
<li>total=$[ ${10} * ${11} ]</li>
</ul>
<p>各种i++</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre><span class="comment">$((i=i</span><span class="literal">+</span><span class="comment">1))</span>
<span class="comment">$((i</span><span class="literal">+</span><span class="literal">+</span><span class="comment">))</span>
<span class="comment">$</span><span class="title">[</span> <span class="comment">i</span><span class="literal">+</span><span class="literal">+</span> <span class="title">]</span>
<span class="comment">let</span> <span class="comment">"i</span><span class="literal">+</span><span class="literal">+</span><span class="comment">"</span>
<span class="comment">((i</span><span class="literal">+</span><span class="literal">+</span><span class="comment">))</span>
</pre></td></tr></table></figure>
<p><strong><strong>使用双尖括号</strong></strong></p>
<p><strong>(( expression ))</strong></p>
<p>比如:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash</span>
a=<span class="number">10</span>
<span class="keyword">if</span> (( <span class="variable">$a</span> ** <span class="number">2</span> ><span class="number">90</span> )) ;<span class="keyword">then</span>
<span class="built_in">echo</span> <span class="string">"<span class="variable">$a</span>"</span>
(( b = <span class="variable">$a</span> ** <span class="number">2</span> ))
<span class="built_in">echo</span> <span class="variable">$b</span>
<span class="keyword">fi</span>
</pre></td></tr></table></figure>
<p>还有其他表达式:</p>
<h2 id="-http-localhost-8080-png-"><img src="http://localhost:8080/双括号.png" alt=""></h2>
<p><em>使用双方括号</em></p>
<p><strong>[[ expression ]]</strong></p>
<p>模式匹配,你可以自定义正则表达式。</p>
<h6 id="for-c-">for循环语句 { 类C语言 }</h6>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre><span class="keyword">for</span>((<span class="operator">a</span>=<span class="number">1</span>;<span class="operator">a</span><<span class="number">5</span>;<span class="operator">a</span>++)){
echo <span class="string">"$a"</span>
}
</pre></td></tr></table></figure>
<p><em>or</em></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre>Shell 格式:
<span class="keyword">for</span>((a=<span class="number">1</span>;a<<span class="number">5</span>;a++))
<span class="keyword">do</span>
<span class="built_in">echo</span> <span class="string">"<span class="variable">$a</span>"</span>
<span class="keyword">done</span>
</pre></td></tr></table></figure>
<hr>
<p><strong>重定向</strong></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
</pre></td><td class="code"><pre>for(()){
} > /output.txt
<span class="code">-----
or
-----</span>
for(())
do
done | sort
</pre></td></tr></table></figure>
<p>${!#} 返回命令行的脚本名</p>
<p>$* 保存单个单词</p>
<p>$@ 保存,类似数组</p>
<hr>
<p><strong>getopt</strong></p>
<p>处理命令行选项和参数</p>
<figure class="highlight `"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash</span>
`<span class="keyword">set</span> -- getopt -q ab:c <span class="string">"<span class="variable">$@</span>"</span>` `
<span class="keyword">while</span> [ -n <span class="variable">$1</span> ]
<span class="keyword">do</span>
<span class="keyword">case</span> <span class="string">"<span class="variable">$1</span>"</span> <span class="keyword">in</span>
<span class="operator">-a</span>) <span class="built_in">echo</span> <span class="string">"Found the -a option"</span> ;;
-b) param=<span class="string">"<span class="variable">$2</span>"</span>
<span class="built_in">echo</span> <span class="string">"Found the -b option.with parameter value <span class="variable">$param</span>"</span>
shift;;
-c)
<span class="built_in">echo</span> <span class="string">"Found the -c option"</span> ;;
--) shift
<span class="keyword">break</span>;;
*) <span class="built_in">echo</span> <span class="string">"<span class="variable">$1</span> is not an option"</span> ;;
shift
<span class="keyword">done</span>
</pre></td></tr></table></figure>
<h5 id="-getopts-"><strong>getopts</strong></h5>
<p><del>page284</del></p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash</span>
<span class="comment">#</span>
<span class="keyword">while</span> <span class="built_in">getopts</span> <span class="string">":ab:cd"</span> opt
<span class="keyword">do</span>
<span class="keyword">case</span> <span class="string">"<span class="variable">$opt</span>"</span> <span class="keyword">in</span>
a) <span class="built_in">echo</span> <span class="string">"Option \"a\""</span>;;
b) <span class="built_in">echo</span> <span class="string">"Option \"b\" "</span><span class="variable">$OPTARG</span><span class="string">""</span>;;
c) <span class="built_in">echo</span> <span class="string">"Option \"c\""</span>;;
d) <span class="built_in">echo</span> <span class="string">"Option \"d\""</span>;;
<span class="keyword">esac</span>
<span class="keyword">done</span>
<span class="keyword">exit</span> <span class="number">0</span>
```language
</pre></td></tr></table></figure>
<hr>
<p><strong>永久重定向</strong></p>
<p>--在脚本中添加下行</p>
<p><code>exec 1>outfile</code></p>
<p>所有正常输出将重定向至outfile中。</p>
<p><code>exec 2>outfile</code></p>
<p>错误输出</p>
<h6 id="-shell-9-">在Shell中最多可以有9个打开的文件描述符</h6>
<p>创建自定义文件描述符(3-8)</p>
<p>比如:</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash</span>
<span class="keyword">exec</span> <span class="number">3</span>>outfile3.out
<span class="comment">#exec 3>>outfile3.out</span>
<span class="comment">#顾名思义是追加</span>
<span class="built_in">echo</span> <span class="string">"输出正常"</span> >&<span class="number">3</span>
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash
</span>
<span class="keyword">exec</span> <span class="number">6</span><&<span class="number">0</span>
<span class="keyword">exec</span> <span class="number">0</span>< testfile
count=<span class="number">1</span>
<span class="keyword">while</span> <span class="built_in">read</span> line
<span class="keyword">do</span>
<span class="built_in">echo</span> <span class="string">"Line #<span class="variable">$count</span>: <span class="variable">$line</span>"</span>
((count++))
<span class="keyword">done</span>
<span class="keyword">exec</span> <span class="number">0</span><&<span class="number">6</span>
<span class="built_in">read</span> <span class="operator">-s</span> -p <span class="string">"Are you done now?"</span> answer
<span class="keyword">case</span> <span class="variable">$answer</span> <span class="keyword">in</span>
y|y)
<span class="built_in">echo</span> <span class="string">"Goodbye"</span>
;;
N|n)
<span class="built_in">echo</span> <span class="string">"sorry. this is the end."</span>
;;
*)
<span class="built_in">echo</span> <span class="string">"Doesn't Matter"</span>
;;
<span class="keyword">esac</span>
</pre></td></tr></table></figure>
<p>关闭文件描述符</p>
<p><code>exec 3>&-</code></p>
<p><code>mktemp -t test.XXXXXX</code></p>
<p>在/tmp目录下创建临时文件</p>
<p><code>mktemp -d dir.XXXXXX</code></p>
<hr>
<p>捕捉信号:</p>
<p>trap command SIGINT SIGTERM</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
</pre></td><td class="code"><pre>1) SIGHUP 2) SIGINT 3) SIGQUIT 4) SIGILL 5) SIGTRAP
6) SIGABRT 7) SIGBUS 8) SIGFPE 9) SIGKILL 10) SIGUSR1
11) SIGSEGV 12) SIGUSR2 13) SIGPIPE 14) SIGALRM 15) SIGTERM
16) SIGSTKFLT 17) SIGCHLD 18) SIGCONT 19) SIGSTOP 20) SIGTSTP
21) SIGTTIN 22) SIGTTOU 23) SIGURG 24) SIGXCPU 25) SIGXFSZ
26) SIGVTALRM 27) SIGPROF 28) SIGWINCH 29) SIGIO 30) SIGPWR
31) SIGSYS 34) SIGRTMIN 35) SIGRTMIN+1 36) SIGRTMIN+2 37) SIGRTMIN+3
38) SIGRTMIN+4 39) SIGRTMIN+5 40) SIGRTMIN+6 41) SIGRTMIN+7 42) SIGRTMIN+8
43) SIGRTMIN+9 44) SIGRTMIN+10 45) SIGRTMIN+11 46) SIGRTMIN+12 47) SIGRTMIN+13
48) SIGRTMIN+14 49) SIGRTMIN+15 50) SIGRTMAX-14 51) SIGRTMAX-13 52) SIGRTMAX-12
53) SIGRTMAX-11 54) SIGRTMAX-10 55) SIGRTMAX-9 56) SIGRTMAX-8 57) SIGRTMAX-7
58) SIGRTMAX-6 59) SIGRTMAX-5 60) SIGRTMAX-4 61) SIGRTMAX-3 62) SIGRTMAX-2
63) SIGRTMAX-1 64) SIGRTMAX
</pre></td></tr></table></figure>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre><span class="shebang">#!/bin/bash</span>
trap <span class="string">"echo 'ByeBye'"</span> EXIT
<span class="keyword">for</span>((a=<span class="number">1</span>;a<<span class="number">10</span>;a++)){
<span class="built_in">echo</span> <span class="string">"Line <span class="variable">$a</span>"</span>
sleep <span class="number">1</span>
}
trap - EXIT
<span class="built_in">echo</span> <span class="string">"移除退出信号"</span>
</pre></td></tr></table></figure>
<p><strong>crontab</strong></p>
<p>每月最后一天</p>
<figure class="highlight"><table><tr><td class="gutter"><pre>1
2
3
</pre></td><td class="code"><pre><span class="keyword">if</span> [ `<span class="built_in">date</span> +%d -d tomorrow` = <span class="number">01</span> ]; <span class="keyword">then</span>
<span class="command"><span class="keyword">command</span></span>
fi
</pre></td></tr></table></figure>
<p><code>00 12 * * * if [ `date +%d -d tomorrow` = 01 ];then : command</code></p>
]]></content>
</entry>
<entry>
<title><![CDATA[VCAP510]]></title>
<link href="http://www.succw.com/vcap510/"/>
<id>http://www.succw.com/vcap510/</id>