開発中の bashlib
Revision | 8409a74ea7a9f722ed903714343d73c59de1cf07 (tree) |
---|---|
Zeit | 2011-10-09 09:07:06 |
Autor | Your Name <you@exam...> |
Commiter | Your Name |
update
@@ -0,0 +1,96 @@ | ||
1 | +Option Explicit | |
2 | + | |
3 | +'// Copyright (C) 2007-2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved. | |
4 | + | |
5 | + | |
6 | +Sub Main( Opt, AppKey ) | |
7 | + Dim out : out = GetAbsPath( "..\english", Empty ) | |
8 | + Dim w_:Set w_=AppKey.NewWritable( out ).Enable() '// XNvgªA±Ìt@Cª étH_[Ⱥð«Ýū鿤ɷéB | |
9 | + Dim ds_: Set ds_ = new CurDirStack | |
10 | + | |
11 | + echo_line | |
12 | + echo "pêÅ("+ out +")ðêxíµÄAì輵ܷB" | |
13 | + Pause | |
14 | + | |
15 | + del out | |
16 | + | |
17 | + copy "README", out | |
18 | + copy "..\menu", out | |
19 | + copy "..\sample", out | |
20 | + copy "..\scriptlib", out | |
21 | + copy "..\test\Test.sh", out+"\test" | |
22 | + copy "..\test\ans", out+"\test" | |
23 | + | |
24 | + pushd out +"\sample" | |
25 | + Translate "samples.trans", "JP", "EN" | |
26 | + | |
27 | + cd out +"\scriptlib" | |
28 | + Translate "bashlib.trans", "JP", "EN" | |
29 | + | |
30 | + popd | |
31 | + | |
32 | + ren out +"\test", "test_patch" | |
33 | + | |
34 | + echo "scriptlib(vbslib) ðíµÄ¾³¢B" | |
35 | +End Sub | |
36 | + | |
37 | + | |
38 | + | |
39 | + | |
40 | + | |
41 | + | |
42 | + | |
43 | + | |
44 | + | |
45 | + | |
46 | +'--- start of vbslib include ------------------------------------------------------ | |
47 | + | |
48 | +'// ±±Ìà©ç Main ÖðÄÑoµÄ¢Ü·B | |
49 | +'// ܽAscriptlib tH_[ðTµÄAvbslib ðCN[hµÄ¢Ü· | |
50 | + | |
51 | +'// vbslib is provided under 3-clause BSD license. | |
52 | +'// Copyright (C) 2007-2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved. | |
53 | + | |
54 | +Dim g_Vers : If IsEmpty( g_Vers ) Then | |
55 | +Set g_Vers = CreateObject("Scripting.Dictionary") : g_Vers.Add "vbslib", 4.0 | |
56 | +Dim g_debug, g_debug_params, g_admin, g_vbslib_path, g_CommandPrompt, g_fs, g_sh, g_AppKey | |
57 | +Dim g_MainPath, g_SrcPath, g_f, g_include_path, i, g_debug_tree, g_debug_process, g_b_compile_debug | |
58 | +g_SrcPath = WScript.ScriptFullName : g_MainPath = g_SrcPath | |
59 | +SetupVbslibParameters | |
60 | +Set g_fs = CreateObject( "Scripting.FileSystemObject" ) | |
61 | +Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory | |
62 | +g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName ) | |
63 | +For i = 20 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For | |
64 | +g_vbslib_path = "..\" + g_vbslib_path : Next | |
65 | +If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path ) | |
66 | +g_sh.CurrentDirectory = g_f | |
67 | +If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+_ | |
68 | + "Let's download vbslib "&g_Vers.Item("vbslib")&" and Copy scriptlib folder." : Stop : WScript.Quit 1 | |
69 | +Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty | |
70 | +If ResumePush Then On Error Resume Next | |
71 | + CallMainFromVbsLib | |
72 | +ResumePop : On Error GoTo 0 | |
73 | +End If | |
74 | +'--------------------------------------------------------------------------------- | |
75 | + | |
76 | +Sub SetupDebugTools() | |
77 | + set_input "" | |
78 | + SetBreakByFName Empty | |
79 | + SetStartSectionTree "" | |
80 | +End Sub | |
81 | + | |
82 | +Sub SetupVbslibParameters() | |
83 | + '--- start of parameters for vbslib include ------------------------------- | |
84 | + '// g_Vers("OldMain") = 1 | |
85 | + g_vbslib_path = "scriptlib\vbs_inc.vbs" | |
86 | + g_CommandPrompt = 2 | |
87 | + | |
88 | + g_debug = 0 '// release:0, debug:99, -1:call SetupDebugTools | |
89 | + '// lrItBXâRpCª êÎAg_debug ð 1 ÈãÉ·éÆfobK[ªg¦Ü·B | |
90 | + '// XebvÀsðJn·éêâAÏÌlðmFµ½¢êÉAStop ½ßðLqµÄ¾³¢B | |
91 | + | |
92 | + '--- end of parameters for vbslib include --------------------------------- | |
93 | +End Sub | |
94 | +'--- end of vbslib include -------------------------------------------------------- | |
95 | + | |
96 | + |
@@ -0,0 +1,25 @@ | ||
1 | + ((( bashlib 1 - Short Hand Library for bash ))) | |
2 | + | |
3 | +bashlib provides basic functions, when you used bash shell as script engine. | |
4 | +bashlib runs on bash ver3 pre-installed in Ubuntu, MacOS X, and so on. | |
5 | + | |
6 | + | |
7 | +You can try it now ... | |
8 | + for Ubuntu : Double click "menu" file and select "Run in Terminal". | |
9 | + for MacOS X : Double click "menu" file. | |
10 | + for shell : cd bashlib and ./menu | |
11 | + | |
12 | +- document (folder) : Document of bashlib | |
13 | +- scriptlib (folder) : bashlib script library | |
14 | +- samples (folder) : The sample of main scripts | |
15 | +- test (folder) : Test Kit. This folder is made by menu | |
16 | + | |
17 | + | |
18 | +Copyright and License: | |
19 | + bashlib ver1 Oct.9, 2011 | |
20 | + Copyright (c) 2011, T's-Neko at Sage Plaisir 21 (Japan) | |
21 | + All rights reserved. Based on 3-clause BSD license. | |
22 | + | |
23 | +Support: | |
24 | + Sofrware Design Gallery "Sage Plaisir 21" http://www.sage-p.com/ | |
25 | + |
@@ -15,13 +15,13 @@ | ||
15 | 15 | <A href="#table-of-contents" style="color:blue;">→ もくじ</A> |
16 | 16 | </DIV> |
17 | 17 | |
18 | -<svg width="691" height="961" __viewBox="00000 00000 00691 64483"> | |
19 | - <g id="page1" width="627" height="941" transform="translate(+10,+10)"> | |
18 | +<svg width="691" height="1007" __viewBox="00000 00000 00691 64529"> | |
19 | + <g id="page1" width="627" height="987" transform="translate(+10,+10)"> | |
20 | 20 | <line class="page_bound" x1="-0.5" y1="-0.5" x2="627.5" y2="-0.5" style="stroke:rgb(0,0,0);stroke-width:1"/> |
21 | - <line class="page_bound" x1="-0.5" y1="-0.5" x2="-0.5" y2="941.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
22 | - <line class="page_bound" x1="627.5" y1="-0.5" x2="627.5" y2="941.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
23 | - <line class="page_bound" x1="-0.5" y1="941.5" x2="627.5" y2="941.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
24 | - <image x="47" y="620" width="16" height="16" xlink:href="data:;base64, | |
21 | + <line class="page_bound" x1="-0.5" y1="-0.5" x2="-0.5" y2="987.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
22 | + <line class="page_bound" x1="627.5" y1="-0.5" x2="627.5" y2="987.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
23 | + <line class="page_bound" x1="-0.5" y1="987.5" x2="627.5" y2="987.5" style="stroke:rgb(0,0,0);stroke-width:1"/> | |
24 | + <image x="47" y="617" width="16" height="16" xlink:href="data:;base64, | |
25 | 25 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx |
26 | 26 | |
27 | 27 | jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU |
@@ -31,7 +31,7 @@ OE+VUgkOwCAI216mT9vT8GWOwwOqmRlZFjRtoeBda716lFI4zTnxn0hyi5TkpgUTPEdvWWKqGM5g | ||
31 | 31 | gjT0OOtRPg4imsIdg4Qu3xRWzoEAdTYtaYXHd+gdIkEb+EMAA3MybqTBw1b+q6U43mnELw0rgF1Y |
32 | 32 | |
33 | 33 | azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/> |
34 | - <image x="47" y="643" width="16" height="16" xlink:href="data:;base64, | |
34 | + <image x="47" y="640" width="16" height="16" xlink:href="data:;base64, | |
35 | 35 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx |
36 | 36 | |
37 | 37 | jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU |
@@ -41,7 +41,7 @@ OE+VUgkOwCAI216mT9vT8GWOwwOqmRlZFjRtoeBda716lFI4zTnxn0hyi5TkpgUTPEdvWWKqGM5g | ||
41 | 41 | gjT0OOtRPg4imsIdg4Qu3xRWzoEAdTYtaYXHd+gdIkEb+EMAA3MybqTBw1b+q6U43mnELw0rgF1Y |
42 | 42 | |
43 | 43 | azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/> |
44 | - <image x="184" y="584" width="31" height="28" xlink:href="data:;base64, | |
44 | + <image x="184" y="581" width="31" height="28" xlink:href="data:;base64, | |
45 | 45 | /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK |
46 | 46 | |
47 | 47 | CwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU |
@@ -89,7 +89,7 @@ MznCM1yyV0fjz8I/irqvxS8eeJvDs/7Y0XhuOyv1tdG1DU/CMMcWtQkf61S7IIju4COckEEdwP0J | ||
89 | 89 | /ZM/ZO1T9nbX/H/iPxH4+m+IHifxhLZte3zaYliiLbrIqYRXbJIlOTkDCjjqT7BH8H/AcMiSR+Cf |
90 | 90 | |
91 | 91 | DiSIwZWXSbcFSDkEHZ1FdaAB261pOtUqK05N+rIhRp03eEUvRH//2Q=="/> |
92 | - <image x="47" y="666" width="16" height="16" xlink:href="data:;base64, | |
92 | + <image x="47" y="663" width="16" height="16" xlink:href="data:;base64, | |
93 | 93 | iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx |
94 | 94 | |
95 | 95 | jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU |
@@ -132,43 +132,43 @@ azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/> | ||
132 | 132 | <rect x="26.5" y="431.5" width="108" height="26" style="fill:rgb(254,210,129);stroke:rgb(0,0,0);stroke-width:1"/> |
133 | 133 | <text x="45.5px" y="448.5px" style="fill:rgb(0,0,0);font-family:MS-PGothic,sans-serif;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">ダウンロード</text> |
134 | 134 | </g> |
135 | - <a xlink:href="bashlib-1.0.0.tar.bz2" target="_blank"> | |
135 | + <a xlink:href="http://www.sage-p.com/b/bashlib-1.0.0.tar.bz2" target="_blank"> | |
136 | 136 | <text x="155.5px" y="448.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">→ bashlib-1.0.0.tar.bz2</text> |
137 | 137 | </a> |
138 | 138 | <text x="344.5px" y="448.5px" style="fill:rgb(0,128,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">for bash ver3以上 (Linux, MacOS X)</text> |
139 | - <text x="19.5px" y="720.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">ライセンス</text> | |
139 | + <text x="19.5px" y="745.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">ライセンス</text> | |
140 | 140 | <a xlink:href="http://ja.wikipedia.org/wiki/BSD%E3%83%A9%E3%82%A4%E3%82%BB%E3%83%B3%E3%82%B9" target="_blank"> |
141 | - <text x="74.5px" y="858.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ BSDライセンス - Wikipedia (Web)</text> | |
141 | + <text x="74.5px" y="883.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ BSDライセンス - Wikipedia (Web)</text> | |
142 | 142 | </a> |
143 | 143 | <g> |
144 | - <rect x="37.5" y="794.5" width="502" height="40" style="fill:rgb(231,231,231);stroke:rgb(0,0,0);stroke-width:1"/> | |
145 | - <text x="45.5px" y="810.5px" style="fill:rgb(0,0,0);font-family:Osaka-mono,MS-Gothic,monospace;font-size:9pt;text-anchor:start" xml:space="preserve">bashlib is provided under 3-clause BSD license.<tspan x="45.5px" y="825.5px" xml:space="preserve">Copyright (C) 2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.</tspan></text> | |
144 | + <rect x="37.5" y="819.5" width="502" height="40" style="fill:rgb(231,231,231);stroke:rgb(0,0,0);stroke-width:1"/> | |
145 | + <text x="45.5px" y="835.5px" style="fill:rgb(0,0,0);font-family:Osaka-mono,MS-Gothic,monospace;font-size:9pt;text-anchor:start" xml:space="preserve">bashlib is provided under 3-clause BSD license.<tspan x="45.5px" y="850.5px" xml:space="preserve">Copyright (C) 2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.</tspan></text> | |
146 | 146 | </g> |
147 | - <text x="27.5px" y="858.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">参考</text> | |
148 | - <text x="30.5px" y="749.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">無料でお使いいただけますが、無保証です。<tspan x="30.5px" y="764.5px" xml:space="preserve">再頒布や加工もファイルに書かれた下記を削除しなければ自由にできます。</tspan> | |
149 | - <tspan x="30.5px" y="779.5px" xml:space="preserve">bashlib を参考にして作成したスクリプトやライブラリの著作権は、あなたにあります。</tspan></text> | |
147 | + <text x="27.5px" y="883.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">参考</text> | |
148 | + <text x="30.5px" y="774.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">無料でお使いいただけますが、無保証です。<tspan x="30.5px" y="789.5px" xml:space="preserve">再頒布や加工もファイルに書かれた下記を削除しなければ自由にできます。</tspan> | |
149 | + <tspan x="30.5px" y="804.5px" xml:space="preserve">bashlib を参考にして作成したスクリプトやライブラリの著作権は、あなたにあります。</tspan></text> | |
150 | 150 | <a xlink:href="http://www.sage-p.com/" target="_blank"> |
151 | - <text x="108.5px" y="901.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">ソフトウェアデザイン館 Sage Plaisir 21 http://www.sage-p.com/</text> | |
151 | + <text x="108.5px" y="926.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">ソフトウェアデザイン館 Sage Plaisir 21 http://www.sage-p.com/</text> | |
152 | 152 | </a> |
153 | - <text x="19.5px" y="901.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">サポート先</text> | |
153 | + <text x="19.5px" y="926.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">サポート先</text> | |
154 | 154 | <text x="480.5px" y="35.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">2011/10/9</text> |
155 | 155 | <g> |
156 | 156 | <rect x="16.5" y="13.5" width="38" height="36" style="fill:rgb(0,0,0);stroke:rgb(192,192,192);stroke-width:2"/> |
157 | 157 | <text x="24.5px" y="35.5px" style="fill:rgb(192,192,192);font-family:MS-PGothic,sans-serif;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">$ </text> |
158 | 158 | </g> |
159 | - <text x="234.5px" y="655.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib がベースとするシェルスクリプトの説明です</text> | |
160 | - <text x="234.5px" y="631.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib のマニュアル(本書)です</text> | |
161 | - <text x="70.5px" y="631.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib ヘルプ</text> | |
162 | - <text x="19.5px" y="602.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">画面で見るマニュアル</text> | |
159 | + <text x="234.5px" y="652.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib がベースとするシェルスクリプトの説明です</text> | |
160 | + <text x="234.5px" y="628.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib のマニュアル(本書)です</text> | |
161 | + <text x="70.5px" y="628.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib ヘルプ</text> | |
162 | + <text x="19.5px" y="599.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">画面で見るマニュアル</text> | |
163 | 163 | <a onclick="return false"> |
164 | - <text x="70.5px" y="655.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">シェルスクリプト(bash)</text> | |
164 | + <text x="70.5px" y="652.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">シェルスクリプト(bash)</text> | |
165 | 165 | </a> |
166 | - <text x="19.5px" y="551.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">インストール</text> | |
166 | + <text x="19.5px" y="548.5px" style="fill:rgb(64,128,128);font-family:メイリオ;font-size:10pt;font-weight:bold;text-anchor:start" xml:space="preserve">インストール</text> | |
167 | 167 | <a xlink:href="#" onclick="window.location.hash='install'; return false"> |
168 | - <text x="138.5px" y="551.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ インストール</text> | |
168 | + <text x="138.5px" y="548.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ インストール</text> | |
169 | 169 | </a> |
170 | 170 | <a xlink:href="#" onclick="window.location.hash='uninst'; return false"> |
171 | - <text x="279.5px" y="551.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ アンインストール</text> | |
171 | + <text x="279.5px" y="548.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">→ アンインストール</text> | |
172 | 172 | </a> |
173 | 173 | <text x="34.5px" y="480.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">とりあえず動かしてみたいときは、</text> |
174 | 174 | <text x="383.5px" y="35.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve"> version 1</text> |
@@ -188,14 +188,19 @@ azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/> | ||
188 | 188 | <text x="248.5px" y="480.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">bashlib の menu</text> |
189 | 189 | </a> |
190 | 190 | <text x="364.5px" y="480.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">を開いてください。</text> |
191 | - <text x="34.5px" y="498.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">この文書の固定幅フォントは、Ubuntu の Chrome と FireFox に合わせてあります。</text> | |
191 | + <text x="34.5px" y="498.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">この文書(HTML5)を見るときは、Chrome または Mac OS X の Safari をお使いください。</text> | |
192 | 192 | <a onclick="return false"> |
193 | - <text x="70.5px" y="679.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">UNIX & Linux</text> | |
193 | + <text x="70.5px" y="676.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">UNIX & Linux</text> | |
194 | 194 | </a> |
195 | - <text x="234.5px" y="679.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">ファイルやシェルの基本的なコマンドの説明です。</text> | |
195 | + <text x="234.5px" y="676.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:10pt;text-anchor:start" xml:space="preserve">ファイルやシェルの基本的なコマンドの説明です。</text> | |
196 | 196 | <a xlink:href="http://www.sage-p.com/freesoft.htm" target="_blank"> |
197 | - <text x="338.5px" y="923.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:7pt;text-anchor:start" xml:space="preserve">この文書は Snap Note を使って作られています。</text> | |
197 | + <text x="338.5px" y="948.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:7pt;text-anchor:start" xml:space="preserve">この文書は Snap Note を使って作られています。</text> | |
198 | 198 | </a> |
199 | + <text x="70.5px" y="700.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:8pt;text-anchor:start" xml:space="preserve">上記リンク先は、</text> | |
200 | + <a xlink:href="http://www.sage-p.com/vbslib/bashlib.files/bashlib.html" target="_blank"> | |
201 | + <text x="159.5px" y="700.5px" style="fill:rgb(0,0,255);font-family:メイリオ;font-size:8pt;text-anchor:start" xml:space="preserve">Internet Explorer 版の文書</text> | |
202 | + </a> | |
203 | + <text x="301.5px" y="700.5px" style="fill:rgb(0,0,0);font-family:メイリオ;font-size:8pt;text-anchor:start" xml:space="preserve">でのみ参照できます。</text> | |
199 | 204 | </g> |
200 | 205 | |
201 | 206 | </svg> |
@@ -1115,7 +1120,7 @@ g_flags = new Array( 0, | ||
1115 | 1120 | </TD></TR></TABLE> |
1116 | 1121 | |
1117 | 1122 | |
1118 | -<svg width="00691" height="64483"> | |
1123 | +<svg width="00691" height="64529"> | |
1119 | 1124 | |
1120 | 1125 | <g id="page2" width="578" height="868" transform="translate(+10,+10)"> |
1121 | 1126 | <line class="page_bound" x1="-0.5" y1="-0.5" x2="578.5" y2="-0.5" style="stroke:rgb(0,0,0);stroke-width:1"/> |
@@ -12,7 +12,7 @@ You can try it now ... | ||
12 | 12 | - document (folder) : Document of bashlib |
13 | 13 | - scriptlib (folder) : bashlib script library |
14 | 14 | - samples (folder) : The sample of main scripts |
15 | -- test (folder) : Test Kit | |
15 | +- test (folder) : Test Kit. This folder is made by menu | |
16 | 16 | |
17 | 17 | |
18 | 18 | Copyright and License: |
@@ -33,7 +33,7 @@ function Main_func() | ||
33 | 33 | "Test" "Test_sth_func" \ |
34 | 34 | |
35 | 35 | SetAttr_as_AssociativeArrayName_func $obj MenuCaption \ |
36 | - "1" "Open help (for HTML5+SVG browser) [Help]" \ | |
36 | + "1" "Open Japanese help (for HTML5+SVG browser, Chrome, Safari) [Help]" \ | |
37 | 37 | "2" "Search file [SearchFile]" \ |
38 | 38 | "3" "New - Shell script file for bashlib [NewSh]" \ |
39 | 39 | "4" "New - Menu with shorthand prompt [NewMenu]" \ |
@@ -61,7 +61,7 @@ $declare_AssociativeArrayClass g_InputCommandOpt | ||
61 | 61 | #//********************************************************************* |
62 | 62 | function Help_sth_func() |
63 | 63 | { |
64 | - local abs_path ; GetAbsPath_func "document/bashlib.html" ; abs_path="$g_Ret" | |
64 | + local abs_path ; GetAbsPath_func "../document/bashlib.html" ; abs_path="$g_Ret" | |
65 | 65 | local commands |
66 | 66 | local apps |
67 | 67 |
@@ -187,7 +187,7 @@ function NewShSub_sth_func() | ||
187 | 187 | |
188 | 188 | #// guide |
189 | 189 | name=`basename "$path"` |
190 | - echo "You can start by input \"./name\" in shell" | |
190 | + echo "You can start by input \"./$name\" in shell" | |
191 | 191 | } |
192 | 192 | |
193 | 193 |
@@ -272,10 +272,10 @@ function chmod_x_sth_func() | ||
272 | 272 | #//********************************************************************* |
273 | 273 | function Test_sth_func() |
274 | 274 | { |
275 | - if [ ! -e "test" ];then | |
276 | - if [ -e "../test/Test.sh" ];then | |
277 | - cp -rap "../test" "." | |
278 | - fi | |
275 | + if [ -e "test_patch" ];then | |
276 | + cp -Rap "../test" "." | |
277 | + cp -Rap test_patch/* "test" | |
278 | + rm -r "test_patch" | |
279 | 279 | fi |
280 | 280 | |
281 | 281 | test/Test.sh |
@@ -1,6 +1,7 @@ | ||
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <Translate> |
3 | 3 | <File charset="utf-8">../menu</File> |
4 | +<File charset="utf-8">../test/Test.sh</File> | |
4 | 5 | <File charset="utf-8">Menu.sh</File> |
5 | 6 | <File charset="utf-8">OptionCall.sh</File> |
6 | 7 | <File charset="utf-8">Sample.sh</File> |
@@ -24,7 +25,8 @@ | ||
24 | 25 | <!-- ../menu --> |
25 | 26 | |
26 | 27 | <T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) </JP> |
27 | - <EN>Open help (for HTML5+SVG browser)</EN></T> | |
28 | + <EN>Open japanese help (for HTML5+SVG browser)</EN></T> | |
29 | +<T><JP>document/bashlib.html</JP><EN>../document/bashlib.html</EN></T> | |
28 | 30 | <T><JP>ファイルを検索する</JP><EN>Search file</EN></T> |
29 | 31 | <T><JP>新規作成する - bashlib が使えるシェル・スクリプト・ファイル</JP> |
30 | 32 | <EN>New - Shell script file for bashlib</EN></T> |
@@ -48,7 +50,7 @@ | ||
48 | 50 | <T><JP>$parent_path/scriptlib フォルダーを作成しました。</JP> |
49 | 51 | <EN>Created $parent_path/scriptlib folder.</EN></T> |
50 | 52 | <T><JP>シェルから、『./$name』と入力すると起動できます。</JP> |
51 | - <EN>You can start by input \"./name\" in shell</EN></T> | |
53 | + <EN>You can start by input \"./$name\" in shell</EN></T> | |
52 | 54 | <T><JP>圧縮ファイルのパス</JP><EN>compressed file path</EN></T> |
53 | 55 | <T><JP>ファイル名を一覧する</JP><EN>List up file names</EN></T> |
54 | 56 | <T><JP>解凍先フォルダーのパス</JP><EN>Extracted folder path</EN></T> |
@@ -61,6 +63,13 @@ | ||
61 | 63 | <EN>Test of error message</EN></T> |
62 | 64 | |
63 | 65 | |
66 | +<!-- ../test/Test.sh --> | |
67 | +<T><JP>テスト済みバージョン:</JP><EN>Tested version : </EN></T> | |
68 | +<T><JP>このマシンのバージョン:</JP><EN>This machine's version : </EN></T> | |
69 | +<T><JP> echo "手動テスト(T_*_Manullay.sh) は別途行ってください。"</JP><EN></EN></T> | |
70 | +<T><JP> echo "bashlib へのシンボリック・リンクの中でもテストしてください。"</JP><EN></EN></T> | |
71 | + | |
72 | + | |
64 | 73 | <!-- Menu.sh --> |
65 | 74 | <T><JP>何か文字を入力してください</JP><EN>Type any characters</EN></T> |
66 | 75 | <T><JP>入力した内容は、『$g_Ret』です。</JP><EN>Input characters are \"$g_Ret\".</EN></T> |
@@ -3,6 +3,17 @@ | ||
3 | 3 | <File charset="utf-8">bashlib.sh</File> |
4 | 4 | <File charset="utf-8">bashlib_inc.sh</File> |
5 | 5 | <File charset="utf-8">bashlib3.sh</File> |
6 | +<File charset="utf-8">../test/ans/T_CheckMaxArgCount_ans.txt</File> | |
7 | +<File charset="utf-8">../test/ans/T_CheckPipeStatus_ans.txt</File> | |
8 | +<File charset="utf-8">../test/ans/T_DoneInErrMode_ans.txt</File> | |
9 | +<File charset="utf-8">../test/ans/T_ErrorInErrMode_ans.txt</File> | |
10 | +<File charset="utf-8">../test/ans/T_NotTryLoop_ans.txt</File> | |
11 | +<File charset="utf-8">../test/ans/T_TryLv0_ans.txt</File> | |
12 | +<File charset="utf-8">../test/ans/T_TryLv1_ans.txt</File> | |
13 | +<File charset="utf-8">../test/ans/T_TryLv1Clear_ans.txt</File> | |
14 | +<File charset="utf-8">../test/ans/T_TryLv1Proc1_ans.txt</File> | |
15 | +<File charset="utf-8">../test/ans/T_TryLv2_ans.txt</File> | |
16 | +<File charset="utf-8">../test/ans/T_TryLv2Change_ans.txt</File> | |
6 | 17 | |
7 | 18 | <T><JP>続行するには Enter キーを押してください . . .</JP><EN>Press Enter key to continue ...</EN></T> |
8 | 19 |
@@ -37,6 +48,9 @@ | ||
37 | 48 | <EN>Parameters length is short. specified=${#Arguments[@]}, requested</EN></T> |
38 | 49 | <T><JP>パラメーターが多すぎます。 指定=${#Arguments[@]}, 要求</JP> |
39 | 50 | <EN>Parameters length is long. specified=${#Arguments[@]}, requested</EN></T> |
51 | +<T><JP>パラメーターが多すぎます。 指定=2, 要求=1</JP> | |
52 | + <EN>Parameters length is long. specified=2, requested=1</EN></T> | |
53 | + | |
40 | 54 | |
41 | 55 | <T><JP>すでにファイルが存在しています。</JP><EN>Already file exists.</EN></T> |
42 | 56 | <T><JP>すでにフォルダーが存在しています。</JP><EN>Already folder exists.</EN></T> |
@@ -76,6 +90,9 @@ | ||
76 | 90 | <EN>(Hint for developer) If you want to step runnning, call \"debugger\" at starting point.</EN></T> |
77 | 91 | <T><JP>下記コールツリーの最も下の関数が、\` \` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP> |
78 | 92 | <EN>Cut \` \` from call and get echo return, then show callstack inside.</EN></T> |
93 | +<T><JP>(開発者向けヒント)ステップ実行したいときは、開始するところから "debugger" 関数を呼び出してください。 下記コールツリーの最も下の関数が、` ` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP> | |
94 | + <EN>(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside.</EN></T> | |
95 | + | |
79 | 96 | <T><JP>エラー処理中に別のエラーが発生しました。</JP> |
80 | 97 | <EN>Another error is raised in error handling mode</EN></T> |
81 | 98 | <T><JP>コールツリー:</JP><EN>Call tree:</EN></T> |
@@ -0,0 +1,45 @@ | ||
1 | +#!/bin/bash -eE | |
2 | + #// Content-Type: text/plain; charset=utf-8 | |
3 | + #// -eE option is stop, when error was raised. | |
4 | + #// -x option is display commands one by one. | |
5 | + | |
6 | +function Main_func() | |
7 | +{ | |
8 | + echo "Tested version : GNU bash 4.1.5, 3.2.48" | |
9 | + echo "This machine's version :" | |
10 | + /bin/bash --version | head -n 1 | |
11 | + Pause_func --time_out=10 | |
12 | + ./T_Menu.sh | |
13 | + ./T_File.sh | |
14 | + ./T_Err.sh | |
15 | + ./T_Str.sh | |
16 | + | |
17 | + | |
18 | +} | |
19 | + | |
20 | + | |
21 | + | |
22 | + | |
23 | + | |
24 | + | |
25 | + | |
26 | + | |
27 | + | |
28 | + | |
29 | +#//--- start of bashlib include ------------------------------------------------------ | |
30 | + | |
31 | +#// <<< set up bashlib and call Main_func >>> | |
32 | + | |
33 | +#// bashlib is provided under 3-clause BSD license. | |
34 | +#// Copyright (C) 2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved. | |
35 | + | |
36 | +g_BashLibPath="scriptlib/bashlib_inc.sh"; g_Ver="1.0" | |
37 | +g_StartInPath=`pwd`; cd "`dirname "$BASH_SOURCE"`"; g_Arguments=( "$BASH_SOURCE" "$@" ) | |
38 | +for (( i = 0; i < 20; i ++ ));do | |
39 | + if [ -e "$g_BashLibPath" ];then break ;else g_BashLibPath="../$g_BashLibPath" ;fi ;done | |
40 | +if [ "$i" == "20" ];then echo "${g_BashLibPath##*../} is not found. | |
41 | +Download bashlib $g_Ver and copy scriptlib folder"; exit 1 ;fi | |
42 | +source "$g_BashLibPath" #// include | |
43 | +CallMain_func | |
44 | +#//--- end of bashlib include -------------------------------------------------------- | |
45 | + |
@@ -0,0 +1,11 @@ | ||
1 | + | |
2 | +((( T_AnyTypeErrorSub_func ))) | |
3 | +./T_Err_Sub.sh: line xx: NotDefined_func: コマンドが見つかりません | |
4 | +<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/> | |
5 | + | |
6 | +./T_Err_Sub.sh: line xx: NotDefined: コマンドが見つかりません | |
7 | +<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/> | |
8 | + | |
9 | +./T_Err_Sub.sh: line xx: NotDefined_func: コマンドが見つかりません | |
10 | + | |
11 | + |
@@ -0,0 +1,11 @@ | ||
1 | + | |
2 | +((( T_AnyTypeErrorSub_func ))) | |
3 | +./T_Err_Sub.sh: line xx: NotDefined_func: command not found | |
4 | +<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/> | |
5 | + | |
6 | +./T_Err_Sub.sh: line xx: NotDefined: command not found | |
7 | +<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/> | |
8 | + | |
9 | +./T_Err_Sub.sh: line xx: NotDefined_func: command not found | |
10 | + | |
11 | + |
@@ -0,0 +1,13 @@ | ||
1 | + | |
2 | +((( T_AssertSub_func ))) | |
3 | +<ERROR msg="Assert failed"><Expression><![CDATA[ | |
4 | +"$var1" == "ABC" | |
5 | +]]></Expression><Result><![CDATA[ | |
6 | +abc == ABC | |
7 | +]]></Result></ERROR> | |
8 | +<ERROR msg="Assert failed"><Expression><![CDATA[ | |
9 | +$( ReturnIt_func "あいう" ) == "アイウ" | |
10 | +]]></Expression><Result><![CDATA[ | |
11 | +あいう == アイウ | |
12 | +]]></Result></ERROR> | |
13 | +call EchoTest_func |
@@ -0,0 +1,5 @@ | ||
1 | + | |
2 | +((( T_CheckMaxArgCountSub_func ))) | |
3 | +Parameters length is long. specified=2, requested=1 | |
4 | +command line: T_CheckMaxArgCountSubSub_func 1 B | |
5 | +This error is OK |
@@ -0,0 +1,17 @@ | ||
1 | + | |
2 | +((( T_CheckPipeStatusSub_func ))) | |
3 | +1st | |
4 | +${PIPESTATUS[@]} = 1 0 | |
5 | +This error is OK | |
6 | +2nd | |
7 | +${PIPESTATUS[@]} = 1 0 | |
8 | +[31;1m<ERROR/>[m | |
9 | +Exit Status = 1 | |
10 | +------------------------------------------------------------------------------- | |
11 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
12 | +Call tree: | |
13 | +(global) ./T_Err_Sub.sh:xx | |
14 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
15 | + Main_func() ./T_Err_Sub.sh:xx | |
16 | + T_CheckPipeStatusSub_func() ./T_Err_Sub.sh:xx | |
17 | +<ERROR/> |
@@ -0,0 +1,14 @@ | ||
1 | + | |
2 | +((( T_DoneInErrModeSub_func ))) | |
3 | +0 | |
4 | +after done_func | |
5 | +[31;1m<ERROR/>[m | |
6 | +Exit Status = 1 | |
7 | +------------------------------------------------------------------------------- | |
8 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
9 | +Call tree: | |
10 | +(global) ./T_Err_Sub.sh:xx | |
11 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
12 | + Main_func() ./T_Err_Sub.sh:xx | |
13 | + T_DoneInErrModeSub_func() ./T_Err_Sub.sh:xx | |
14 | +<ERROR/> |
@@ -0,0 +1,20 @@ | ||
1 | + | |
2 | +((( T_ErrorInErrModeSub_func ))) | |
3 | +<ERROR msg="Another error is raised in error handling mode"/> | |
4 | +[31;1m<ERROR msg="2nd" attr="1"/>[m | |
5 | +Call tree: | |
6 | +(global) ./T_Err_Sub.sh:xx | |
7 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
8 | + Main_func() ./T_Err_Sub.sh:xx | |
9 | + T_ErrorInErrModeSub_func() ./T_Err_Sub.sh:xx | |
10 | + T_ErrorInErrModeSubSub_func() ./T_Err_Sub.sh:xx | |
11 | +[31;1m<ERROR msg="1st"/>[m | |
12 | +Exit Status = 1 | |
13 | +------------------------------------------------------------------------------- | |
14 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
15 | +Call tree: | |
16 | +(global) ./T_Err_Sub.sh:xx | |
17 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
18 | + Main_func() ./T_Err_Sub.sh:xx | |
19 | + T_ErrorInErrModeSub_func() ./T_Err_Sub.sh:xx | |
20 | +<ERROR msg="1st"/> |
@@ -0,0 +1,12 @@ | ||
1 | + | |
2 | +((( T_NotTryLoopSub_func ))) | |
3 | +[31;1m<ERROR msg="B"/>[m | |
4 | +Exit Status = 1 | |
5 | +------------------------------------------------------------------------------- | |
6 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
7 | +Call tree: | |
8 | +(global) ./T_Err_Sub.sh:xx | |
9 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
10 | + Main_func() ./T_Err_Sub.sh:xx | |
11 | + T_NotTryLoopSub_func() ./T_Err_Sub.sh:xx | |
12 | +<ERROR msg="B"/> |
@@ -0,0 +1,14 @@ | ||
1 | + | |
2 | +((( T_TryLv0Sub_func ))) | |
3 | +Try_Raise_func (in) | |
4 | +[31;1m<ERROR msg="in Try_Raise_func"/>[m | |
5 | +Exit Status = 1 | |
6 | +------------------------------------------------------------------------------- | |
7 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
8 | +Call tree: | |
9 | +(global) ./T_Err_Sub.sh:xx | |
10 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
11 | + Main_func() ./T_Err_Sub.sh:xx | |
12 | + T_TryLv0Sub_func() ./T_Err_Sub.sh:xx | |
13 | + Try_Raise_func() ./T_Err_Sub.sh:xx | |
14 | +<ERROR msg="in Try_Raise_func"/> |
@@ -0,0 +1,5 @@ | ||
1 | + | |
2 | +((( T_TryLv1ClearSub_func ))) | |
3 | +Try_Raise_func (in) | |
4 | +exit status = 1 | |
5 | +after try block |
@@ -0,0 +1,28 @@ | ||
1 | + | |
2 | +((( T_TryLv1Proc1Sub_func ))) | |
3 | +Try_Raise2_func (in) | |
4 | +exit status = 2 | |
5 | +after try lv2 block | |
6 | +[31;1m<ERROR/>[m | |
7 | +Exit Status = 2 | |
8 | +------------------------------------------------------------------------------- | |
9 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
10 | +Call tree: | |
11 | +(global) ./T_Err_Sub.sh:xx | |
12 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
13 | + Main_func() ./T_Err_Sub.sh:xx | |
14 | + T_TryLv1Proc1SubSub_func() ./T_Err_Sub.sh:xx | |
15 | + Try_Raise2_func() ./T_Err_Sub.sh:xx | |
16 | +<ERROR/> | |
17 | +exit status = 2 | |
18 | +after try lv1 block | |
19 | +[31;1m<ERROR/>[m | |
20 | +Exit Status = 2 | |
21 | +------------------------------------------------------------------------------- | |
22 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
23 | +Call tree: | |
24 | +(global) ./T_Err_Sub.sh:xx | |
25 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
26 | + Main_func() ./T_Err_Sub.sh:xx | |
27 | + T_TryLv1Proc1Sub_func() ./T_Err_Sub.sh:xx | |
28 | +<ERROR/> |
@@ -0,0 +1,16 @@ | ||
1 | + | |
2 | +((( T_TryLv1Sub_func ))) | |
3 | +Try_Raise_func (in) | |
4 | +exit status = 1 | |
5 | +after try block | |
6 | +[31;1m<ERROR msg="in Try_Raise_func"/>[m | |
7 | +Exit Status = 1 | |
8 | +------------------------------------------------------------------------------- | |
9 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
10 | +Call tree: | |
11 | +(global) ./T_Err_Sub.sh:xx | |
12 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
13 | + Main_func() ./T_Err_Sub.sh:xx | |
14 | + T_TryLv1Sub_func() ./T_Err_Sub.sh:xx | |
15 | + Try_Raise_func() ./T_Err_Sub.sh:xx | |
16 | +<ERROR msg="in Try_Raise_func"/> |
@@ -0,0 +1,17 @@ | ||
1 | + | |
2 | +((( T_TryLv2ChangeSub_func ))) | |
3 | +exit status = 1 | |
4 | +after try lv2 block | |
5 | +exit status = 1 | |
6 | +after try lv1 block | |
7 | +[31;1m<ERROR msg="Overwritten Message"/>[m | |
8 | +Exit Status = 1 | |
9 | +------------------------------------------------------------------------------- | |
10 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
11 | +Call tree: | |
12 | +(global) ./T_Err_Sub.sh:xx | |
13 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
14 | + Main_func() ./T_Err_Sub.sh:xx | |
15 | + T_TryLv2ChangeSub_func() ./T_Err_Sub.sh:xx | |
16 | + T_TryLv2ChangeSubSub_func() ./T_Err_Sub.sh:xx | |
17 | +<ERROR msg="Overwritten Message"/> |
@@ -0,0 +1,19 @@ | ||
1 | + | |
2 | +((( T_TryLv2Sub_func ))) | |
3 | +Try_Raise2_func (in) | |
4 | +exit status = 2 | |
5 | +after try lv2 block | |
6 | +exit status = 2 | |
7 | +after try lv1 block | |
8 | +[31;1m<ERROR/>[m | |
9 | +Exit Status = 2 | |
10 | +------------------------------------------------------------------------------- | |
11 | +(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside. | |
12 | +Call tree: | |
13 | +(global) ./T_Err_Sub.sh:xx | |
14 | + CallMain_func() ../scriptlib/bashlib.sh:xx | |
15 | + Main_func() ./T_Err_Sub.sh:xx | |
16 | + T_TryLv2Sub_func() ./T_Err_Sub.sh:xx | |
17 | + T_TryLv2SubSub_func() ./T_Err_Sub.sh:xx | |
18 | + Try_Raise2_func() ./T_Err_Sub.sh:xx | |
19 | +<ERROR/> |
@@ -0,0 +1,9 @@ | ||
1 | + | |
2 | +((( T_WSSub_func ))) | |
3 | +Dump "$var" == 'AB DE' | |
4 | +00000000 41 42 20 20 44 45 |AB DE| | |
5 | +00000006 | |
6 | +Dump "$var2" == 'AB CD | |
7 | +E' | |
8 | +00000000 41 42 09 43 44 0a 45 |AB.CD.E| | |
9 | +00000007 |
@@ -33,7 +33,7 @@ function Main_func() | ||
33 | 33 | "Test" "Test_sth_func" \ |
34 | 34 | |
35 | 35 | SetAttr_as_AssociativeArrayName_func $obj MenuCaption \ |
36 | - "1" "ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) [Help]" \ | |
36 | + "1" "ヘルプを開く (HTML5+SVG 対応ブラウザ Chrome, Safari で見えます) [Help]" \ | |
37 | 37 | "2" "ファイルを検索する [SearchFile]" \ |
38 | 38 | "3" "新規作成する - bashlib が使えるシェル・スクリプト・ファイル [NewSh]" \ |
39 | 39 | "4" "新規作成する - ショートハンド・プロンプトのメニュー [NewMenu]" \ |
@@ -272,10 +272,10 @@ function chmod_x_sth_func() | ||
272 | 272 | #//********************************************************************* |
273 | 273 | function Test_sth_func() |
274 | 274 | { |
275 | - if [ ! -e "test" ];then | |
276 | - if [ -e "../test/Test.sh" ];then | |
277 | - cp -rap "../test" "." | |
278 | - fi | |
275 | + if [ -e "test_patch" ];then | |
276 | + cp -Rap "../test" "." | |
277 | + cp -Rap test_patch/* "test" | |
278 | + rm -r "test_patch" | |
279 | 279 | fi |
280 | 280 | |
281 | 281 | test/Test.sh |
@@ -1,6 +1,7 @@ | ||
1 | 1 | <?xml version="1.0" encoding="UTF-8"?> |
2 | 2 | <Translate> |
3 | 3 | <File charset="utf-8">../menu</File> |
4 | +<File charset="utf-8">../test/Test.sh</File> | |
4 | 5 | <File charset="utf-8">Menu.sh</File> |
5 | 6 | <File charset="utf-8">OptionCall.sh</File> |
6 | 7 | <File charset="utf-8">Sample.sh</File> |
@@ -23,8 +24,9 @@ | ||
23 | 24 | |
24 | 25 | <!-- ../menu --> |
25 | 26 | |
26 | -<T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) </JP> | |
27 | - <EN>Open help (for HTML5+SVG browser)</EN></T> | |
27 | +<T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザ Chrome, Safari で見えます)</JP> | |
28 | + <EN>Open Japanese help (for HTML5+SVG browser, Chrome, Safari)</EN></T> | |
29 | +<T><JP>document/bashlib.html</JP><EN>../document/bashlib.html</EN></T> | |
28 | 30 | <T><JP>ファイルを検索する</JP><EN>Search file</EN></T> |
29 | 31 | <T><JP>新規作成する - bashlib が使えるシェル・スクリプト・ファイル</JP> |
30 | 32 | <EN>New - Shell script file for bashlib</EN></T> |
@@ -48,7 +50,7 @@ | ||
48 | 50 | <T><JP>$parent_path/scriptlib フォルダーを作成しました。</JP> |
49 | 51 | <EN>Created $parent_path/scriptlib folder.</EN></T> |
50 | 52 | <T><JP>シェルから、『./$name』と入力すると起動できます。</JP> |
51 | - <EN>You can start by input \"./name\" in shell</EN></T> | |
53 | + <EN>You can start by input \"./$name\" in shell</EN></T> | |
52 | 54 | <T><JP>圧縮ファイルのパス</JP><EN>compressed file path</EN></T> |
53 | 55 | <T><JP>ファイル名を一覧する</JP><EN>List up file names</EN></T> |
54 | 56 | <T><JP>解凍先フォルダーのパス</JP><EN>Extracted folder path</EN></T> |
@@ -61,6 +63,13 @@ | ||
61 | 63 | <EN>Test of error message</EN></T> |
62 | 64 | |
63 | 65 | |
66 | +<!-- ../test/Test.sh --> | |
67 | +<T><JP>テスト済みバージョン:</JP><EN>Tested version : </EN></T> | |
68 | +<T><JP>このマシンのバージョン:</JP><EN>This machine's version : </EN></T> | |
69 | +<T><JP> echo "手動テスト(T_*_Manullay.sh) は別途行ってください。"</JP><EN></EN></T> | |
70 | +<T><JP> echo "bashlib へのシンボリック・リンクの中でもテストしてください。"</JP><EN></EN></T> | |
71 | + | |
72 | + | |
64 | 73 | <!-- Menu.sh --> |
65 | 74 | <T><JP>何か文字を入力してください</JP><EN>Type any characters</EN></T> |
66 | 75 | <T><JP>入力した内容は、『$g_Ret』です。</JP><EN>Input characters are \"$g_Ret\".</EN></T> |
@@ -3,6 +3,17 @@ | ||
3 | 3 | <File charset="utf-8">bashlib.sh</File> |
4 | 4 | <File charset="utf-8">bashlib_inc.sh</File> |
5 | 5 | <File charset="utf-8">bashlib3.sh</File> |
6 | +<File charset="utf-8">../test/ans/T_CheckMaxArgCount_ans.txt</File> | |
7 | +<File charset="utf-8">../test/ans/T_CheckPipeStatus_ans.txt</File> | |
8 | +<File charset="utf-8">../test/ans/T_DoneInErrMode_ans.txt</File> | |
9 | +<File charset="utf-8">../test/ans/T_ErrorInErrMode_ans.txt</File> | |
10 | +<File charset="utf-8">../test/ans/T_NotTryLoop_ans.txt</File> | |
11 | +<File charset="utf-8">../test/ans/T_TryLv0_ans.txt</File> | |
12 | +<File charset="utf-8">../test/ans/T_TryLv1_ans.txt</File> | |
13 | +<File charset="utf-8">../test/ans/T_TryLv1Clear_ans.txt</File> | |
14 | +<File charset="utf-8">../test/ans/T_TryLv1Proc1_ans.txt</File> | |
15 | +<File charset="utf-8">../test/ans/T_TryLv2_ans.txt</File> | |
16 | +<File charset="utf-8">../test/ans/T_TryLv2Change_ans.txt</File> | |
6 | 17 | |
7 | 18 | <T><JP>続行するには Enter キーを押してください . . .</JP><EN>Press Enter key to continue ...</EN></T> |
8 | 19 |
@@ -37,6 +48,9 @@ | ||
37 | 48 | <EN>Parameters length is short. specified=${#Arguments[@]}, requested</EN></T> |
38 | 49 | <T><JP>パラメーターが多すぎます。 指定=${#Arguments[@]}, 要求</JP> |
39 | 50 | <EN>Parameters length is long. specified=${#Arguments[@]}, requested</EN></T> |
51 | +<T><JP>パラメーターが多すぎます。 指定=2, 要求=1</JP> | |
52 | + <EN>Parameters length is long. specified=2, requested=1</EN></T> | |
53 | + | |
40 | 54 | |
41 | 55 | <T><JP>すでにファイルが存在しています。</JP><EN>Already file exists.</EN></T> |
42 | 56 | <T><JP>すでにフォルダーが存在しています。</JP><EN>Already folder exists.</EN></T> |
@@ -76,6 +90,9 @@ | ||
76 | 90 | <EN>(Hint for developer) If you want to step runnning, call \"debugger\" at starting point.</EN></T> |
77 | 91 | <T><JP>下記コールツリーの最も下の関数が、\` \` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP> |
78 | 92 | <EN>Cut \` \` from call and get echo return, then show callstack inside.</EN></T> |
93 | +<T><JP>(開発者向けヒント)ステップ実行したいときは、開始するところから "debugger" 関数を呼び出してください。 下記コールツリーの最も下の関数が、` ` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP> | |
94 | + <EN>(Hint for developer) If you want to step runnning, call "debugger" at starting point. Cut ` ` from call and get echo return, then show callstack inside.</EN></T> | |
95 | + | |
79 | 96 | <T><JP>エラー処理中に別のエラーが発生しました。</JP> |
80 | 97 | <EN>Another error is raised in error handling mode</EN></T> |
81 | 98 | <T><JP>コールツリー:</JP><EN>Call tree:</EN></T> |
@@ -255,7 +255,10 @@ function T_TryEnd2NoParam_func() | ||
255 | 255 | T_TryEnd2NoParamSub_func |
256 | 256 | TryEnd1_func; done ;TryEnd2_func $? |
257 | 257 | StringClass.indexOf_method "$g_Err_Desc" "パラメーターの数" |
258 | - if [ "$g_Ret" == "-1" ]; then Error_func ;fi | |
258 | + if [ "$g_Ret" == "-1" ]; then | |
259 | + StringClass.indexOf_method "$g_Err_Desc" "parameters length" | |
260 | + if [ "$g_Ret" == "-1" ]; then Error_func ;fi | |
261 | + fi | |
259 | 262 | if [ "$g_ExitStatus" == "0" ]; then Error_func "Error exptected" ;fi |
260 | 263 | echo "${g_Err_Desc}${LF}This error is OK"; ErrClass.clear_method |
261 | 264 | } |
@@ -281,7 +284,10 @@ function T_DoneNoParam_func() | ||
281 | 284 | T_DoneNoParamSub_func |
282 | 285 | TryEnd1_func; done ;TryEnd2_func $? |
283 | 286 | StringClass.indexOf_method "$g_Err_Desc" "パラメーターの数" |
284 | - if [ "$g_Ret" == "-1" ]; then Error_func ;fi | |
287 | + if [ "$g_Ret" == "-1" ]; then | |
288 | + StringClass.indexOf_method "$g_Err_Desc" "parameters length" | |
289 | + if [ "$g_Ret" == "-1" ]; then Error_func ;fi | |
290 | + fi | |
285 | 291 | if [ "$g_ExitStatus" == "0" ]; then Error_func "Error exptected" ;fi |
286 | 292 | echo "${g_Err_Desc}${LF}This error is OK"; ErrClass.clear_method |
287 | 293 | } |
@@ -340,7 +346,7 @@ function RunAndLogCheck_func() | ||
340 | 346 | ./T_Err_Sub.sh --$SubProcessFuncName 2>&1 | tee out.txt |
341 | 347 | TryEnd1_func; done ;TryEnd2_func $? |
342 | 348 | if [ "$g_ExitStatus" != "0" ];then echo "This error is OK" ;fi |
343 | - sed -i.bak -e "s/:[0-9]*$/:xx/" \ | |
349 | + sed -i.bak -e "s/:[0-9][0-9]*$/:xx/" \ | |
344 | 350 | -e "s/line [0-9]*: NotDefined/line xx: NotDefined/" \ |
345 | 351 | -e "s/行 [0-9]*: NotDefined/line xx: NotDefined/" \ |
346 | 352 | out.txt ; rm out.txt.bak |
@@ -1155,7 +1155,10 @@ function T_local_func() | ||
1155 | 1155 | echo "$g_Err_Desc" |
1156 | 1156 | if [ "$g_ExitStatus" == "0" ]; then Error_func "Error exptected" ;fi |
1157 | 1157 | StringClass.indexOf_method "$g_Err_Desc" "出力引数" |
1158 | - Assert_func $g_Ret -gt 0 | |
1158 | + if [ "$g_Ret" == "-1" ];then | |
1159 | + StringClass.indexOf_method "$g_Err_Desc" "Output argument" | |
1160 | + if [ "$g_Ret" == "-1" ];then Error_func ;fi | |
1161 | + fi | |
1159 | 1162 | ErrClass.clear_method |
1160 | 1163 | echo "This error is OK" |
1161 | 1164 |
@@ -1174,7 +1177,10 @@ function T_local_func() | ||
1174 | 1177 | echo "$g_Err_Desc" |
1175 | 1178 | if [ "$g_ExitStatus" == "0" ]; then Error_func "Error exptected" ;fi |
1176 | 1179 | StringClass.indexOf_method "$g_Err_Desc" "出力引数" |
1177 | - Assert_func $g_Ret -gt 0 | |
1180 | + if [ "$g_Ret" == "-1" ];then | |
1181 | + StringClass.indexOf_method "$g_Err_Desc" "Output argument" | |
1182 | + if [ "$g_Ret" == "-1" ];then Error_func ;fi | |
1183 | + fi | |
1178 | 1184 | ErrClass.clear_method |
1179 | 1185 | echo "This error is OK" |
1180 | 1186 | } |
@@ -5,9 +5,9 @@ | ||
5 | 5 | |
6 | 6 | function Main_func() |
7 | 7 | { |
8 | - echo "テスト済み: GNU bash 4.1.5, 3.2.48" | |
9 | - echo "" | |
10 | - /bin/bash --version | |
8 | + echo "テスト済みバージョン: GNU bash 4.1.5, 3.2.48" | |
9 | + echo "このマシンのバージョン:" | |
10 | + /bin/bash --version | head -n 1 | |
11 | 11 | Pause_func --time_out=10 |
12 | 12 | ./T_Menu.sh |
13 | 13 | ./T_File.sh |