OSDN Git Service

update
authorYour Name <you@example.com>
Sat, 8 Oct 2011 17:07:24 +0000 (02:07 +0900)
committerYour Name <you@example.com>
Sun, 9 Oct 2011 00:07:06 +0000 (09:07 +0900)
29 files changed:
document/MakeEnglish.vbs [new file with mode: 0755]
document/README [new file with mode: 0755]
document/bashlib.html
english/README
english/menu
english/sample/samples.trans
english/scriptlib/bashlib.trans
english/test_patch/Test.sh [new file with mode: 0755]
english/test_patch/ans/T_AnyTypeError_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_AnyTypeError_en_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_Assert_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_CheckMaxArgCount_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_CheckPipeStatus_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_DoneInErrMode_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_ErrorInErrMode_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_NotTryLoop_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv0_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv1Clear_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv1Proc1_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv1_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv2Change_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_TryLv2_ans.txt [new file with mode: 0644]
english/test_patch/ans/T_WS_ans.txt [new file with mode: 0644]
menu
sample/samples.trans
scriptlib/bashlib.trans
test/T_Err.sh
test/T_Str.sh
test/Test.sh

diff --git a/document/MakeEnglish.vbs b/document/MakeEnglish.vbs
new file mode 100755 (executable)
index 0000000..7bdbea1
--- /dev/null
@@ -0,0 +1,96 @@
+Option Explicit \r
+\r
+'// Copyright (C) 2007-2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.\r
+\r
+\r
+Sub  Main( Opt, AppKey )\r
+  Dim  out : out = GetAbsPath( "..\english", Empty )\r
+  Dim  w_:Set w_=AppKey.NewWritable( out ).Enable()  '// \83X\83N\83\8a\83v\83g\82ª\81A\82±\82Ì\83t\83@\83C\83\8b\82ª\82 \82é\83t\83H\83\8b\83_\81[\88È\89º\82ð\8f\91\82«\8d\9e\82Ý\82Å\82«\82é\82æ\82¤\82É\82·\82é\81B\r
+  Dim  ds_: Set ds_ = new CurDirStack\r
+\r
+  echo_line\r
+  echo  "\89p\8cê\94Å("+ out +")\82ð\88ê\93x\8dí\8f\9c\82µ\82Ä\81A\8dì\82è\92¼\82µ\82Ü\82·\81B"\r
+  Pause\r
+\r
+  del  out\r
+\r
+  copy  "README", out\r
+  copy  "..\menu", out\r
+  copy  "..\sample", out\r
+  copy  "..\scriptlib", out\r
+  copy  "..\test\Test.sh", out+"\test"\r
+  copy  "..\test\ans", out+"\test"\r
+\r
+  pushd  out +"\sample"\r
+  Translate  "samples.trans", "JP", "EN"\r
+\r
+  cd  out +"\scriptlib"\r
+  Translate  "bashlib.trans", "JP", "EN"\r
+\r
+  popd\r
+\r
+  ren  out +"\test",  "test_patch"\r
+\r
+  echo  "scriptlib(vbslib) \82ð\8dí\8f\9c\82µ\82Ä\82­\82¾\82³\82¢\81B"\r
+End Sub\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
+\r
\r
+'--- start of vbslib include ------------------------------------------------------ \r
+\r
+'// \82±\82±\82Ì\93à\95\94\82©\82ç Main \8aÖ\90\94\82ð\8cÄ\82Ñ\8fo\82µ\82Ä\82¢\82Ü\82·\81B\r
+'// \82Ü\82½\81Ascriptlib \83t\83H\83\8b\83_\81[\82ð\92T\82µ\82Ä\81Avbslib \82ð\83C\83\93\83N\83\8b\81[\83h\82µ\82Ä\82¢\82Ü\82·\r
+\r
+'// vbslib is provided under 3-clause BSD license.\r
+'// Copyright (C) 2007-2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.\r
+\r
+Dim  g_Vers : If IsEmpty( g_Vers ) Then\r
+Set  g_Vers = CreateObject("Scripting.Dictionary") : g_Vers.Add "vbslib", 4.0\r
+Dim  g_debug, g_debug_params, g_admin, g_vbslib_path, g_CommandPrompt, g_fs, g_sh, g_AppKey\r
+Dim  g_MainPath, g_SrcPath, g_f, g_include_path, i, g_debug_tree, g_debug_process, g_b_compile_debug\r
+g_SrcPath = WScript.ScriptFullName : g_MainPath = g_SrcPath\r
+SetupVbslibParameters\r
+Set  g_fs = CreateObject( "Scripting.FileSystemObject" )\r
+Set  g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory\r
+g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )\r
+For i = 20 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then  Exit For\r
+g_vbslib_path = "..\" + g_vbslib_path  : Next\r
+If g_fs.FileExists(g_vbslib_path) Then  g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path )\r
+g_sh.CurrentDirectory = g_f\r
+If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+_\r
+  "Let's download vbslib "&g_Vers.Item("vbslib")&" and Copy scriptlib folder." : Stop : WScript.Quit 1\r
+Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty\r
+If ResumePush Then  On Error Resume Next\r
+  CallMainFromVbsLib\r
+ResumePop : On Error GoTo 0\r
+End If\r
+'---------------------------------------------------------------------------------\r
+\r
+Sub  SetupDebugTools()\r
+  set_input  ""\r
+  SetBreakByFName  Empty\r
+  SetStartSectionTree  ""\r
+End Sub\r
+\r
+Sub  SetupVbslibParameters()\r
+  '--- start of parameters for vbslib include -------------------------------\r
+  '// g_Vers("OldMain") = 1\r
+  g_vbslib_path = "scriptlib\vbs_inc.vbs"\r
+  g_CommandPrompt = 2\r
+\r
+  g_debug = 0   '// release:0, debug:99, -1:call SetupDebugTools\r
+                '// \82l\82r\83I\83t\83B\83X\82â\83R\83\93\83p\83C\83\89\82ª\82 \82ê\82Î\81Ag_debug \82ð 1 \88È\8fã\82É\82·\82é\82Æ\83f\83o\83b\83K\81[\82ª\8eg\82¦\82Ü\82·\81B\r
+                '// \83X\83e\83b\83v\8eÀ\8ds\82ð\8aJ\8en\82·\82é\8fê\8f\8a\82â\81A\95Ï\90\94\82Ì\92l\82ð\8am\94F\82µ\82½\82¢\8fê\8f\8a\82É\81AStop \96½\97ß\82ð\8bL\8fq\82µ\82Ä\82­\82¾\82³\82¢\81B\r
+\r
+  '--- end of parameters for vbslib include ---------------------------------\r
+End Sub\r
+'--- end of vbslib include --------------------------------------------------------\r
+\r
\r
diff --git a/document/README b/document/README
new file mode 100755 (executable)
index 0000000..62858b3
--- /dev/null
@@ -0,0 +1,25 @@
+  ((( bashlib 1 - Short Hand Library for bash )))
+
+bashlib provides basic functions, when you used bash shell as script engine.
+bashlib runs on bash ver3 pre-installed in Ubuntu, MacOS X, and so on.
+
+
+You can try it now ...
+ for Ubuntu :  Double click "menu" file and select "Run in Terminal".
+ for MacOS X : Double click "menu" file.
+ for shell :   cd bashlib and ./menu
+
+- document (folder)   : Document of bashlib
+- scriptlib (folder)  : bashlib script library
+- samples (folder)    : The sample of main scripts
+- test (folder)       : Test Kit. This folder is made by menu
+
+
+Copyright and License:
+ bashlib  ver1  Oct.9, 2011
+ Copyright (c) 2011, T's-Neko at Sage Plaisir 21 (Japan)
+ All rights reserved. Based on 3-clause BSD license.
+
+Support:
+ Sofrware Design Gallery "Sage Plaisir 21"  http://www.sage-p.com/
+
index f16879d..e65477c 100644 (file)
 <A href="#table-of-contents" style="color:blue;">→ もくじ</A>\r
 </DIV>\r
 \r
-<svg width="691" height="961" __viewBox="00000 00000 00691 64483">\r
-       <g id="page1" width="627" height="941" transform="translate(+10,+10)">\r
+<svg width="691" height="1007" __viewBox="00000 00000 00691 64529">\r
+       <g id="page1" width="627" height="987" transform="translate(+10,+10)">\r
                <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"/>\r
-               <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"/>\r
-               <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"/>\r
-               <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"/>\r
-               <image x="47" y="620" width="16" height="16" xlink:href="data:;base64,\r
+               <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"/>\r
+               <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"/>\r
+               <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"/>\r
+               <image x="47" y="617" width="16" height="16" xlink:href="data:;base64,\r
 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx\r
 \r
 jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU\r
@@ -31,7 +31,7 @@ OE+VUgkOwCAI216mT9vT8GWOwwOqmRlZFjRtoeBda716lFI4zTnxn0hyi5TkpgUTPEdvWWKqGM5g
 gjT0OOtRPg4imsIdg4Qu3xRWzoEAdTYtaYXHd+gdIkEb+EMAA3MybqTBw1b+q6U43mnELw0rgF1Y\r
 \r
 azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/>\r
-               <image x="47" y="643" width="16" height="16" xlink:href="data:;base64,\r
+               <image x="47" y="640" width="16" height="16" xlink:href="data:;base64,\r
 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx\r
 \r
 jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU\r
@@ -41,7 +41,7 @@ OE+VUgkOwCAI216mT9vT8GWOwwOqmRlZFjRtoeBda716lFI4zTnxn0hyi5TkpgUTPEdvWWKqGM5g
 gjT0OOtRPg4imsIdg4Qu3xRWzoEAdTYtaYXHd+gdIkEb+EMAA3MybqTBw1b+q6U43mnELw0rgF1Y\r
 \r
 azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/>\r
-               <image x="184" y="584" width="31" height="28" xlink:href="data:;base64,\r
+               <image x="184" y="581" width="31" height="28" xlink:href="data:;base64,\r
 /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsK\r
 \r
 CwsNDhIQDQ4RDgsLEBYQERMUFRUVDA8XGBYUGBIUFRT/2wBDAQMEBAUEBQkFBQkUDQsNFBQUFBQU\r
@@ -89,7 +89,7 @@ MznCM1yyV0fjz8I/irqvxS8eeJvDs/7Y0XhuOyv1tdG1DU/CMMcWtQkf61S7IIju4COckEEdwP0J
 /ZM/ZO1T9nbX/H/iPxH4+m+IHifxhLZte3zaYliiLbrIqYRXbJIlOTkDCjjqT7BH8H/AcMiSR+Cf\r
 \r
 DiSIwZWXSbcFSDkEHZ1FdaAB261pOtUqK05N+rIhRp03eEUvRH//2Q=="/>\r
-               <image x="47" y="666" width="16" height="16" xlink:href="data:;base64,\r
+               <image x="47" y="663" width="16" height="16" xlink:href="data:;base64,\r
 iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAIAAACQkWg2AAAAAXNSR0IArs4c6QAAAARnQU1BAACx\r
 \r
 jwv8YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAJZJREFU\r
@@ -132,43 +132,43 @@ azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/>
                        <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"/>\r
                        <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>\r
                </g>\r
-               <a xlink:href="bashlib-1.0.0.tar.bz2" target="_blank">\r
+               <a xlink:href="http://www.sage-p.com/b/bashlib-1.0.0.tar.bz2" target="_blank">\r
                        <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>\r
                </a>\r
                <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>\r
-               <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>\r
+               <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>\r
                <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">\r
-                       <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>\r
+                       <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>\r
                </a>\r
                <g>\r
-                       <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"/>\r
-                       <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>\r
+                       <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"/>\r
+                       <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>\r
                </g>\r
-               <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>\r
-               <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>\r
-       <tspan x="30.5px" y="779.5px" xml:space="preserve">bashlib を参考にして作成したスクリプトやライブラリの著作権は、あなたにあります。</tspan></text>\r
+               <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>\r
+               <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>\r
+       <tspan x="30.5px" y="804.5px" xml:space="preserve">bashlib を参考にして作成したスクリプトやライブラリの著作権は、あなたにあります。</tspan></text>\r
                <a xlink:href="http://www.sage-p.com/" target="_blank">\r
-                       <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>\r
+                       <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>\r
                </a>\r
-               <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>\r
+               <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>\r
                <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>\r
                <g>\r
                        <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"/>\r
                        <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>\r
                </g>\r
-               <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>\r
-               <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>\r
-               <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>\r
-               <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>\r
+               <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>\r
+               <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>\r
+               <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>\r
+               <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>\r
                <a onclick="return false">\r
-                       <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>\r
+                       <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>\r
                </a>\r
-               <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>\r
+               <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>\r
                <a xlink:href="#" onclick="window.location.hash='install'; return false">\r
-                       <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>\r
+                       <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>\r
                </a>\r
                <a xlink:href="#" onclick="window.location.hash='uninst'; return false">\r
-                       <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>\r
+                       <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>\r
                </a>\r
                <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>\r
                <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>\r
@@ -188,14 +188,19 @@ azBtjuMG2473FVb0wbS9Hw86TwkGAoTw+Pwj2+aD/AJj5Kw2fzgGpAAAAABJRU5ErkJggg=="/>
                        <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>\r
                </a>\r
                <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>\r
-               <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>\r
+               <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>\r
                <a onclick="return false">\r
-                       <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 &amp; Linux</text>\r
+                       <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 &amp; Linux</text>\r
                </a>\r
-               <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>\r
+               <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>\r
                <a xlink:href="http://www.sage-p.com/freesoft.htm" target="_blank">\r
-                       <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>\r
+                       <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>\r
                </a>\r
+               <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>\r
+               <a xlink:href="http://www.sage-p.com/vbslib/bashlib.files/bashlib.html" target="_blank">\r
+                       <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>\r
+               </a>\r
+               <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>\r
        </g>\r
        \r
 </svg>\r
@@ -1115,7 +1120,7 @@ g_flags = new Array( 0,
 </TD></TR></TABLE>\r
 \r
 \r
-<svg width="00691" height="64483">\r
+<svg width="00691" height="64529">\r
 \r
 <g id="page2" width="578" height="868" transform="translate(+10,+10)">\r
                <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"/>\r
index a74da79..62858b3 100644 (file)
@@ -12,7 +12,7 @@ You can try it now ...
 - document (folder)   : Document of bashlib
 - scriptlib (folder)  : bashlib script library
 - samples (folder)    : The sample of main scripts
-- test (folder)       : Test Kit
+- test (folder)       : Test Kit. This folder is made by menu
 
 
 Copyright and License:
index 8720346..f40333c 100755 (executable)
@@ -33,7 +33,7 @@ function  Main_func()
     "Test" "Test_sth_func" \
 
   SetAttr_as_AssociativeArrayName_func  $obj  MenuCaption  \
-    "1" "Open help (for HTML5+SVG browser) [Help]" \
+    "1" "Open Japanese help (for HTML5+SVG browser, Chrome, Safari) [Help]" \
     "2" "Search file [SearchFile]" \
     "3" "New - Shell script file for bashlib [NewSh]" \
     "4" "New - Menu with shorthand prompt [NewMenu]" \
@@ -61,7 +61,7 @@ $declare_AssociativeArrayClass  g_InputCommandOpt
 #//*********************************************************************
 function  Help_sth_func()
 {
-  local  abs_path ; GetAbsPath_func  "document/bashlib.html" ; abs_path="$g_Ret"
+  local  abs_path ; GetAbsPath_func  "../document/bashlib.html" ; abs_path="$g_Ret"
   local  commands
   local  apps
 
@@ -187,7 +187,7 @@ function  NewShSub_sth_func()
 
   #// guide
   name=`basename  "$path"`
-  echo  "You can start by input \"./name\" in shell"
+  echo  "You can start by input \"./$name\" in shell"
 }
 
 
@@ -272,10 +272,10 @@ function  chmod_x_sth_func()
 #//*********************************************************************
 function  Test_sth_func()
 {
-  if [ ! -e "test" ];then
-    if [ -e "../test/Test.sh" ];then
-      cp -rap  "../test"  "."
-    fi
+  if [ -e "test_patch" ];then
+    cp -Rap  "../test"  "."
+    cp -Rap  test_patch/*  "test"
+    rm -r  "test_patch"
   fi
 
   test/Test.sh
index b1af95f..efea9d6 100755 (executable)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Translate>
 <File charset="utf-8">../menu</File>
+<File charset="utf-8">../test/Test.sh</File>
 <File charset="utf-8">Menu.sh</File>
 <File charset="utf-8">OptionCall.sh</File>
 <File charset="utf-8">Sample.sh</File>
@@ -24,7 +25,8 @@
 <!-- ../menu -->
 
 <T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) </JP>
-   <EN>Open help (for HTML5+SVG browser)</EN></T>
+   <EN>Open japanese help (for HTML5+SVG browser)</EN></T>
+<T><JP>document/bashlib.html</JP><EN>../document/bashlib.html</EN></T>
 <T><JP>ファイルを検索する</JP><EN>Search file</EN></T>
 <T><JP>新規作成する - bashlib が使えるシェル・スクリプト・ファイル</JP>
    <EN>New - Shell script file for bashlib</EN></T>
@@ -48,7 +50,7 @@
 <T><JP>$parent_path/scriptlib フォルダーを作成しました。</JP>
    <EN>Created $parent_path/scriptlib folder.</EN></T>
 <T><JP>シェルから、『./$name』と入力すると起動できます。</JP>
-   <EN>You can start by input \"./name\" in shell</EN></T>
+   <EN>You can start by input \"./$name\" in shell</EN></T>
 <T><JP>圧縮ファイルのパス</JP><EN>compressed file path</EN></T>
 <T><JP>ファイル名を一覧する</JP><EN>List up file names</EN></T>
 <T><JP>解凍先フォルダーのパス</JP><EN>Extracted folder path</EN></T>
    <EN>Test of error message</EN></T>
 
 
+<!-- ../test/Test.sh -->
+<T><JP>テスト済みバージョン:</JP><EN>Tested version : </EN></T>
+<T><JP>このマシンのバージョン:</JP><EN>This machine's version : </EN></T>
+<T><JP>  echo  "手動テスト(T_*_Manullay.sh) は別途行ってください。"</JP><EN></EN></T>
+<T><JP>  echo  "bashlib へのシンボリック・リンクの中でもテストしてください。"</JP><EN></EN></T>
+
+
 <!-- Menu.sh -->
 <T><JP>何か文字を入力してください</JP><EN>Type any characters</EN></T>
 <T><JP>入力した内容は、『$g_Ret』です。</JP><EN>Input characters are \"$g_Ret\".</EN></T>
index c6649ef..b3a6678 100755 (executable)
@@ -3,6 +3,17 @@
 <File charset="utf-8">bashlib.sh</File>
 <File charset="utf-8">bashlib_inc.sh</File>
 <File charset="utf-8">bashlib3.sh</File>
+<File charset="utf-8">../test/ans/T_CheckMaxArgCount_ans.txt</File>
+<File charset="utf-8">../test/ans/T_CheckPipeStatus_ans.txt</File>
+<File charset="utf-8">../test/ans/T_DoneInErrMode_ans.txt</File>
+<File charset="utf-8">../test/ans/T_ErrorInErrMode_ans.txt</File>
+<File charset="utf-8">../test/ans/T_NotTryLoop_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv0_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1Clear_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1Proc1_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv2_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv2Change_ans.txt</File>
 
 <T><JP>続行するには Enter キーを押してください . . .</JP><EN>Press Enter key to continue ...</EN></T>
 
@@ -37,6 +48,9 @@
    <EN>Parameters length is short. specified=${#Arguments[@]}, requested</EN></T>
 <T><JP>パラメーターが多すぎます。 指定=${#Arguments[@]}, 要求</JP>
    <EN>Parameters length is long. specified=${#Arguments[@]}, requested</EN></T>
+<T><JP>パラメーターが多すぎます。 指定=2, 要求=1</JP>
+   <EN>Parameters length is long. specified=2, requested=1</EN></T>
+
 
 <T><JP>すでにファイルが存在しています。</JP><EN>Already file exists.</EN></T>
 <T><JP>すでにフォルダーが存在しています。</JP><EN>Already folder exists.</EN></T>
@@ -76,6 +90,9 @@
    <EN>(Hint for developer) If you want to step runnning, call \"debugger\" at starting point.</EN></T>
 <T><JP>下記コールツリーの最も下の関数が、\` \` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP>
    <EN>Cut \` \` from call and get echo return, then show callstack inside.</EN></T>
+<T><JP>(開発者向けヒント)ステップ実行したいときは、開始するところから "debugger" 関数を呼び出してください。 下記コールツリーの最も下の関数が、` ` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP>
+   <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>
+
 <T><JP>エラー処理中に別のエラーが発生しました。</JP>
    <EN>Another error is raised in error handling mode</EN></T>
 <T><JP>コールツリー:</JP><EN>Call tree:</EN></T>
diff --git a/english/test_patch/Test.sh b/english/test_patch/Test.sh
new file mode 100755 (executable)
index 0000000..c02fd1d
--- /dev/null
@@ -0,0 +1,45 @@
+#!/bin/bash -eE
+                  #// Content-Type: text/plain; charset=utf-8
+                  #// -eE option is stop, when error was raised.
+                  #// -x option is display commands one by one.
+
+function  Main_func()
+{
+  echo  "Tested version : GNU bash 4.1.5, 3.2.48"
+  echo  "This machine's version :"
+  /bin/bash --version | head -n 1
+  Pause_func  --time_out=10
+  ./T_Menu.sh
+  ./T_File.sh
+  ./T_Err.sh
+  ./T_Str.sh
+  
+  
+}
+
+
+
+
+
+
+
+
+
+#//--- start of bashlib include ------------------------------------------------------ 
+
+#// <<< set up bashlib and call Main_func >>> 
+
+#// bashlib is provided under 3-clause BSD license.
+#// Copyright (C) 2011 Sofrware Design Gallery "Sage Plaisir 21" All Rights Reserved.
+
+g_BashLibPath="scriptlib/bashlib_inc.sh"; g_Ver="1.0"
+g_StartInPath=`pwd`; cd "`dirname "$BASH_SOURCE"`"; g_Arguments=( "$BASH_SOURCE" "$@" )
+for (( i = 0; i < 20; i ++ ));do
+  if [ -e "$g_BashLibPath" ];then break ;else  g_BashLibPath="../$g_BashLibPath" ;fi ;done
+if [ "$i" == "20" ];then  echo "${g_BashLibPath##*../} is not found.
+Download bashlib $g_Ver and copy scriptlib folder"; exit 1 ;fi
+source  "$g_BashLibPath"  #// include
+CallMain_func
+#//--- end of bashlib include --------------------------------------------------------
diff --git a/english/test_patch/ans/T_AnyTypeError_ans.txt b/english/test_patch/ans/T_AnyTypeError_ans.txt
new file mode 100644 (file)
index 0000000..ffb57ef
--- /dev/null
@@ -0,0 +1,11 @@
+
+((( T_AnyTypeErrorSub_func )))
+./T_Err_Sub.sh: line xx: NotDefined_func: コマンドが見つかりません
+<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/>
+
+./T_Err_Sub.sh: line xx: NotDefined: コマンドが見つかりません
+<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/>
+
+./T_Err_Sub.sh: line xx: NotDefined_func: コマンドが見つかりません
+
+
diff --git a/english/test_patch/ans/T_AnyTypeError_en_ans.txt b/english/test_patch/ans/T_AnyTypeError_en_ans.txt
new file mode 100644 (file)
index 0000000..ac2e3cc
--- /dev/null
@@ -0,0 +1,11 @@
+
+((( T_AnyTypeErrorSub_func )))
+./T_Err_Sub.sh: line xx: NotDefined_func: command not found
+<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/>
+
+./T_Err_Sub.sh: line xx: NotDefined: command not found
+<ERROR msg="local と同時に関数呼び出しするとエラーが発生しても中断しません"/>
+
+./T_Err_Sub.sh: line xx: NotDefined_func: command not found
+
+
diff --git a/english/test_patch/ans/T_Assert_ans.txt b/english/test_patch/ans/T_Assert_ans.txt
new file mode 100644 (file)
index 0000000..f5513a1
--- /dev/null
@@ -0,0 +1,13 @@
+
+((( T_AssertSub_func )))
+<ERROR msg="Assert failed"><Expression><![CDATA[
+"$var1" == "ABC"
+]]></Expression><Result><![CDATA[
+abc == ABC
+]]></Result></ERROR>
+<ERROR msg="Assert failed"><Expression><![CDATA[
+$( ReturnIt_func "あいう" ) == "アイウ"
+]]></Expression><Result><![CDATA[
+あいう == アイウ
+]]></Result></ERROR>
+call EchoTest_func
diff --git a/english/test_patch/ans/T_CheckMaxArgCount_ans.txt b/english/test_patch/ans/T_CheckMaxArgCount_ans.txt
new file mode 100644 (file)
index 0000000..0a5ebaf
--- /dev/null
@@ -0,0 +1,5 @@
+
+((( T_CheckMaxArgCountSub_func )))
+Parameters length is long. specified=2, requested=1
+command line: T_CheckMaxArgCountSubSub_func 1 B
+This error is OK
diff --git a/english/test_patch/ans/T_CheckPipeStatus_ans.txt b/english/test_patch/ans/T_CheckPipeStatus_ans.txt
new file mode 100644 (file)
index 0000000..c3a9b45
--- /dev/null
@@ -0,0 +1,17 @@
+
+((( T_CheckPipeStatusSub_func )))
+1st
+${PIPESTATUS[@]} = 1 0
+This error is OK
+2nd
+${PIPESTATUS[@]} = 1 0
+\e[31;1m<ERROR/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_CheckPipeStatusSub_func() ./T_Err_Sub.sh:xx
+<ERROR/>
diff --git a/english/test_patch/ans/T_DoneInErrMode_ans.txt b/english/test_patch/ans/T_DoneInErrMode_ans.txt
new file mode 100644 (file)
index 0000000..ecb65bb
--- /dev/null
@@ -0,0 +1,14 @@
+
+((( T_DoneInErrModeSub_func )))
+0
+after done_func
+\e[31;1m<ERROR/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_DoneInErrModeSub_func() ./T_Err_Sub.sh:xx
+<ERROR/>
diff --git a/english/test_patch/ans/T_ErrorInErrMode_ans.txt b/english/test_patch/ans/T_ErrorInErrMode_ans.txt
new file mode 100644 (file)
index 0000000..fe56e62
--- /dev/null
@@ -0,0 +1,20 @@
+
+((( T_ErrorInErrModeSub_func )))
+<ERROR msg="Another error is raised in error handling mode"/>
+\e[31;1m<ERROR msg="2nd" attr="1"/>\e[m
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_ErrorInErrModeSub_func() ./T_Err_Sub.sh:xx
+    T_ErrorInErrModeSubSub_func() ./T_Err_Sub.sh:xx
+\e[31;1m<ERROR msg="1st"/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_ErrorInErrModeSub_func() ./T_Err_Sub.sh:xx
+<ERROR msg="1st"/>
diff --git a/english/test_patch/ans/T_NotTryLoop_ans.txt b/english/test_patch/ans/T_NotTryLoop_ans.txt
new file mode 100644 (file)
index 0000000..121aaf9
--- /dev/null
@@ -0,0 +1,12 @@
+
+((( T_NotTryLoopSub_func )))
+\e[31;1m<ERROR msg="B"/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_NotTryLoopSub_func() ./T_Err_Sub.sh:xx
+<ERROR msg="B"/>
diff --git a/english/test_patch/ans/T_TryLv0_ans.txt b/english/test_patch/ans/T_TryLv0_ans.txt
new file mode 100644 (file)
index 0000000..ac5b02c
--- /dev/null
@@ -0,0 +1,14 @@
+
+((( T_TryLv0Sub_func )))
+Try_Raise_func (in)
+\e[31;1m<ERROR msg="in Try_Raise_func"/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv0Sub_func() ./T_Err_Sub.sh:xx
+    Try_Raise_func() ./T_Err_Sub.sh:xx
+<ERROR msg="in Try_Raise_func"/>
diff --git a/english/test_patch/ans/T_TryLv1Clear_ans.txt b/english/test_patch/ans/T_TryLv1Clear_ans.txt
new file mode 100644 (file)
index 0000000..c6b28ed
--- /dev/null
@@ -0,0 +1,5 @@
+
+((( T_TryLv1ClearSub_func )))
+Try_Raise_func (in)
+exit status = 1
+after try block
diff --git a/english/test_patch/ans/T_TryLv1Proc1_ans.txt b/english/test_patch/ans/T_TryLv1Proc1_ans.txt
new file mode 100644 (file)
index 0000000..0f85de8
--- /dev/null
@@ -0,0 +1,28 @@
+
+((( T_TryLv1Proc1Sub_func )))
+Try_Raise2_func (in)
+exit status = 2
+after try lv2 block
+\e[31;1m<ERROR/>\e[m
+Exit Status = 2
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv1Proc1SubSub_func() ./T_Err_Sub.sh:xx
+    Try_Raise2_func() ./T_Err_Sub.sh:xx
+<ERROR/>
+exit status = 2
+after try lv1 block
+\e[31;1m<ERROR/>\e[m
+Exit Status = 2
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv1Proc1Sub_func() ./T_Err_Sub.sh:xx
+<ERROR/>
diff --git a/english/test_patch/ans/T_TryLv1_ans.txt b/english/test_patch/ans/T_TryLv1_ans.txt
new file mode 100644 (file)
index 0000000..36fee7b
--- /dev/null
@@ -0,0 +1,16 @@
+
+((( T_TryLv1Sub_func )))
+Try_Raise_func (in)
+exit status = 1
+after try block
+\e[31;1m<ERROR msg="in Try_Raise_func"/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv1Sub_func() ./T_Err_Sub.sh:xx
+    Try_Raise_func() ./T_Err_Sub.sh:xx
+<ERROR msg="in Try_Raise_func"/>
diff --git a/english/test_patch/ans/T_TryLv2Change_ans.txt b/english/test_patch/ans/T_TryLv2Change_ans.txt
new file mode 100644 (file)
index 0000000..3520cc4
--- /dev/null
@@ -0,0 +1,17 @@
+
+((( T_TryLv2ChangeSub_func )))
+exit status = 1
+after try lv2 block
+exit status = 1
+after try lv1 block
+\e[31;1m<ERROR msg="Overwritten Message"/>\e[m
+Exit Status = 1
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv2ChangeSub_func() ./T_Err_Sub.sh:xx
+    T_TryLv2ChangeSubSub_func() ./T_Err_Sub.sh:xx
+<ERROR msg="Overwritten Message"/>
diff --git a/english/test_patch/ans/T_TryLv2_ans.txt b/english/test_patch/ans/T_TryLv2_ans.txt
new file mode 100644 (file)
index 0000000..6c2d98a
--- /dev/null
@@ -0,0 +1,19 @@
+
+((( T_TryLv2Sub_func )))
+Try_Raise2_func (in)
+exit status = 2
+after try lv2 block
+exit status = 2
+after try lv1 block
+\e[31;1m<ERROR/>\e[m
+Exit Status = 2
+-------------------------------------------------------------------------------
+(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.
+Call tree:
+(global) ./T_Err_Sub.sh:xx
+ CallMain_func() ../scriptlib/bashlib.sh:xx
+  Main_func() ./T_Err_Sub.sh:xx
+   T_TryLv2Sub_func() ./T_Err_Sub.sh:xx
+    T_TryLv2SubSub_func() ./T_Err_Sub.sh:xx
+     Try_Raise2_func() ./T_Err_Sub.sh:xx
+<ERROR/>
diff --git a/english/test_patch/ans/T_WS_ans.txt b/english/test_patch/ans/T_WS_ans.txt
new file mode 100644 (file)
index 0000000..41f8435
--- /dev/null
@@ -0,0 +1,9 @@
+
+((( T_WSSub_func )))
+Dump "$var" == 'AB  DE'
+00000000  41 42 20 20 44 45                                 |AB  DE|
+00000006
+Dump "$var2" == 'AB    CD
+E'
+00000000  41 42 09 43 44 0a 45                              |AB.CD.E|
+00000007
diff --git a/menu b/menu
index b14e0d8..8116186 100755 (executable)
--- a/menu
+++ b/menu
@@ -33,7 +33,7 @@ function  Main_func()
     "Test" "Test_sth_func" \
 
   SetAttr_as_AssociativeArrayName_func  $obj  MenuCaption  \
-    "1" "ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) [Help]" \
+    "1" "ヘルプを開く (HTML5+SVG 対応ブラウザ Chrome, Safari で見えます) [Help]" \
     "2" "ファイルを検索する [SearchFile]" \
     "3" "新規作成する - bashlib が使えるシェル・スクリプト・ファイル [NewSh]" \
     "4" "新規作成する - ショートハンド・プロンプトのメニュー [NewMenu]" \
@@ -272,10 +272,10 @@ function  chmod_x_sth_func()
 #//*********************************************************************
 function  Test_sth_func()
 {
-  if [ ! -e "test" ];then
-    if [ -e "../test/Test.sh" ];then
-      cp -rap  "../test"  "."
-    fi
+  if [ -e "test_patch" ];then
+    cp -Rap  "../test"  "."
+    cp -Rap  test_patch/*  "test"
+    rm -r  "test_patch"
   fi
 
   test/Test.sh
index b1af95f..b49688f 100755 (executable)
@@ -1,6 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <Translate>
 <File charset="utf-8">../menu</File>
+<File charset="utf-8">../test/Test.sh</File>
 <File charset="utf-8">Menu.sh</File>
 <File charset="utf-8">OptionCall.sh</File>
 <File charset="utf-8">Sample.sh</File>
@@ -23,8 +24,9 @@
 
 <!-- ../menu -->
 
-<T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザで見えます) </JP>
-   <EN>Open help (for HTML5+SVG browser)</EN></T>
+<T><JP>ヘルプを開く (HTML5+SVG 対応ブラウザ Chrome, Safari で見えます)</JP>
+   <EN>Open Japanese help (for HTML5+SVG browser, Chrome, Safari)</EN></T>
+<T><JP>document/bashlib.html</JP><EN>../document/bashlib.html</EN></T>
 <T><JP>ファイルを検索する</JP><EN>Search file</EN></T>
 <T><JP>新規作成する - bashlib が使えるシェル・スクリプト・ファイル</JP>
    <EN>New - Shell script file for bashlib</EN></T>
@@ -48,7 +50,7 @@
 <T><JP>$parent_path/scriptlib フォルダーを作成しました。</JP>
    <EN>Created $parent_path/scriptlib folder.</EN></T>
 <T><JP>シェルから、『./$name』と入力すると起動できます。</JP>
-   <EN>You can start by input \"./name\" in shell</EN></T>
+   <EN>You can start by input \"./$name\" in shell</EN></T>
 <T><JP>圧縮ファイルのパス</JP><EN>compressed file path</EN></T>
 <T><JP>ファイル名を一覧する</JP><EN>List up file names</EN></T>
 <T><JP>解凍先フォルダーのパス</JP><EN>Extracted folder path</EN></T>
    <EN>Test of error message</EN></T>
 
 
+<!-- ../test/Test.sh -->
+<T><JP>テスト済みバージョン:</JP><EN>Tested version : </EN></T>
+<T><JP>このマシンのバージョン:</JP><EN>This machine's version : </EN></T>
+<T><JP>  echo  "手動テスト(T_*_Manullay.sh) は別途行ってください。"</JP><EN></EN></T>
+<T><JP>  echo  "bashlib へのシンボリック・リンクの中でもテストしてください。"</JP><EN></EN></T>
+
+
 <!-- Menu.sh -->
 <T><JP>何か文字を入力してください</JP><EN>Type any characters</EN></T>
 <T><JP>入力した内容は、『$g_Ret』です。</JP><EN>Input characters are \"$g_Ret\".</EN></T>
index c6649ef..b3a6678 100755 (executable)
@@ -3,6 +3,17 @@
 <File charset="utf-8">bashlib.sh</File>
 <File charset="utf-8">bashlib_inc.sh</File>
 <File charset="utf-8">bashlib3.sh</File>
+<File charset="utf-8">../test/ans/T_CheckMaxArgCount_ans.txt</File>
+<File charset="utf-8">../test/ans/T_CheckPipeStatus_ans.txt</File>
+<File charset="utf-8">../test/ans/T_DoneInErrMode_ans.txt</File>
+<File charset="utf-8">../test/ans/T_ErrorInErrMode_ans.txt</File>
+<File charset="utf-8">../test/ans/T_NotTryLoop_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv0_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1Clear_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv1Proc1_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv2_ans.txt</File>
+<File charset="utf-8">../test/ans/T_TryLv2Change_ans.txt</File>
 
 <T><JP>続行するには Enter キーを押してください . . .</JP><EN>Press Enter key to continue ...</EN></T>
 
@@ -37,6 +48,9 @@
    <EN>Parameters length is short. specified=${#Arguments[@]}, requested</EN></T>
 <T><JP>パラメーターが多すぎます。 指定=${#Arguments[@]}, 要求</JP>
    <EN>Parameters length is long. specified=${#Arguments[@]}, requested</EN></T>
+<T><JP>パラメーターが多すぎます。 指定=2, 要求=1</JP>
+   <EN>Parameters length is long. specified=2, requested=1</EN></T>
+
 
 <T><JP>すでにファイルが存在しています。</JP><EN>Already file exists.</EN></T>
 <T><JP>すでにフォルダーが存在しています。</JP><EN>Already folder exists.</EN></T>
@@ -76,6 +90,9 @@
    <EN>(Hint for developer) If you want to step runnning, call \"debugger\" at starting point.</EN></T>
 <T><JP>下記コールツリーの最も下の関数が、\` \` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP>
    <EN>Cut \` \` from call and get echo return, then show callstack inside.</EN></T>
+<T><JP>(開発者向けヒント)ステップ実行したいときは、開始するところから "debugger" 関数を呼び出してください。 下記コールツリーの最も下の関数が、` ` を使って echo 出力を取得しているときは、取得しないようにすると、更にコール先の関数が表示されます。</JP>
+   <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>
+
 <T><JP>エラー処理中に別のエラーが発生しました。</JP>
    <EN>Another error is raised in error handling mode</EN></T>
 <T><JP>コールツリー:</JP><EN>Call tree:</EN></T>
index 6da273e..490e32d 100755 (executable)
@@ -255,7 +255,10 @@ function  T_TryEnd2NoParam_func()
     T_TryEnd2NoParamSub_func
   TryEnd1_func; done ;TryEnd2_func $?
   StringClass.indexOf_method  "$g_Err_Desc"  "パラメーターの数"
-  if [ "$g_Ret" == "-1" ]; then  Error_func ;fi
+  if [ "$g_Ret" == "-1" ]; then
+    StringClass.indexOf_method  "$g_Err_Desc"  "parameters length"
+    if [ "$g_Ret" == "-1" ]; then  Error_func  ;fi
+  fi
   if [ "$g_ExitStatus" == "0" ]; then  Error_func  "Error exptected"  ;fi
   echo "${g_Err_Desc}${LF}This error is OK";  ErrClass.clear_method
 }
@@ -281,7 +284,10 @@ function  T_DoneNoParam_func()
     T_DoneNoParamSub_func
   TryEnd1_func; done ;TryEnd2_func $?
   StringClass.indexOf_method  "$g_Err_Desc"  "パラメーターの数"
-  if [ "$g_Ret" == "-1" ]; then  Error_func ;fi
+  if [ "$g_Ret" == "-1" ]; then
+    StringClass.indexOf_method  "$g_Err_Desc"  "parameters length"
+    if [ "$g_Ret" == "-1" ]; then  Error_func  ;fi
+  fi
   if [ "$g_ExitStatus" == "0" ]; then  Error_func  "Error exptected"  ;fi
   echo "${g_Err_Desc}${LF}This error is OK";  ErrClass.clear_method
 }
@@ -340,7 +346,7 @@ function  RunAndLogCheck_func()
     ./T_Err_Sub.sh  --$SubProcessFuncName  2>&1  | tee  out.txt
   TryEnd1_func; done ;TryEnd2_func $?
   if [ "$g_ExitStatus" != "0" ];then  echo  "This error is OK"  ;fi
-  sed -i.bak -e "s/:[0-9]*$/:xx/" \
+  sed -i.bak -e "s/:[0-9][0-9]*$/:xx/" \
              -e "s/line [0-9]*: NotDefined/line xx: NotDefined/" \
              -e   "s/行 [0-9]*: NotDefined/line xx: NotDefined/" \
     out.txt ; rm out.txt.bak
index 4f89dc5..bb17671 100755 (executable)
@@ -1155,7 +1155,10 @@ function  T_local_func()
   echo  "$g_Err_Desc"
   if [ "$g_ExitStatus" == "0" ]; then  Error_func  "Error exptected"  ;fi
   StringClass.indexOf_method  "$g_Err_Desc"  "出力引数"
-  Assert_func  $g_Ret -gt 0
+  if [ "$g_Ret" == "-1" ];then
+    StringClass.indexOf_method  "$g_Err_Desc"  "Output argument"
+    if [ "$g_Ret" == "-1" ];then  Error_func  ;fi
+  fi
   ErrClass.clear_method
   echo  "This error is OK"
 
@@ -1174,7 +1177,10 @@ function  T_local_func()
   echo  "$g_Err_Desc"
   if [ "$g_ExitStatus" == "0" ]; then  Error_func  "Error exptected"  ;fi
   StringClass.indexOf_method  "$g_Err_Desc"  "出力引数"
-  Assert_func  $g_Ret -gt 0
+  if [ "$g_Ret" == "-1" ];then
+    StringClass.indexOf_method  "$g_Err_Desc"  "Output argument"
+    if [ "$g_Ret" == "-1" ];then  Error_func  ;fi
+  fi
   ErrClass.clear_method
   echo  "This error is OK"
 }
index 86749cd..963ca40 100755 (executable)
@@ -5,9 +5,9 @@
 
 function  Main_func()
 {
-  echo  "テスト済み: GNU bash 4.1.5, 3.2.48"
-  echo  ""
-  /bin/bash --version
+  echo  "テスト済みバージョン: GNU bash 4.1.5, 3.2.48"
+  echo  "このマシンのバージョン:"
+  /bin/bash --version | head -n 1
   Pause_func  --time_out=10
   ./T_Menu.sh
   ./T_File.sh