<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Cool Commands</title><link>https://sourceforge.net/p/bashdb/wiki/Cool%2520Commands/</link><description>Recent changes to Cool Commands</description><atom:link href="https://sourceforge.net/p/bashdb/wiki/Cool%20Commands/feed" rel="self"/><language>en</language><lastBuildDate>Sun, 14 Dec 2014 14:56:43 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/bashdb/wiki/Cool%20Commands/feed" rel="self" type="application/rss+xml"/><item><title>Cool Commands modified by Rocky Bernstein</title><link>https://sourceforge.net/p/bashdb/wiki/Cool%2520Commands/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v3
+++ v4
@@ -10,7 +10,7 @@

 The debugger has a mode where anything you type into the debugger that recognized as a debugger command is automatically evaluated as bash code. The way the debugger determines if something is a debugger command is by looking up the first blank-delimited token in a command table and failing to find anything there, in an alias table. Aliases are customizable. (See the help for `alias` and  `unalias`.) Commands are not once they are added. 

-When this mode is set, if what you type is erroneous the corresponding zsh error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a bash command. 
+When this mode is set, if what you type is erroneous the corresponding bash error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a bash command. 

     :::bash
     $ bashdb /etc/init.d/apparmor status
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rocky Bernstein</dc:creator><pubDate>Sun, 14 Dec 2014 14:56:43 -0000</pubDate><guid>https://sourceforge.netf99458b143352875f0c5df15c00db168163cb9a3</guid></item><item><title>Cool Commands modified by Rocky Bernstein</title><link>https://sourceforge.net/p/bashdb/wiki/Cool%2520Commands/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v2
+++ v3
@@ -10,7 +10,7 @@

 The debugger has a mode where anything you type into the debugger that recognized as a debugger command is automatically evaluated as bash code. The way the debugger determines if something is a debugger command is by looking up the first blank-delimited token in a command table and failing to find anything there, in an alias table. Aliases are customizable. (See the help for `alias` and  `unalias`.) Commands are not once they are added. 

-When this mode is set, if what you type is erroneous the corresponding zsh error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a zsh command. 
+When this mode is set, if what you type is erroneous the corresponding zsh error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a bash command. 

     :::bash
     $ bashdb /etc/init.d/apparmor status
&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rocky Bernstein</dc:creator><pubDate>Sun, 14 Dec 2014 14:56:17 -0000</pubDate><guid>https://sourceforge.netdf0d072d1b7b88ba9956eb4aa180ef0e2c16021e</guid></item><item><title>Cool Commands modified by Rocky Bernstein</title><link>https://sourceforge.net/p/bashdb/wiki/Cool%2520Commands/</link><description>&lt;div class="markdown_content"&gt;&lt;pre&gt;--- v1
+++ v2
@@ -8,7 +8,7 @@

 ## Auto Evaluation

-The debugger has a mode where anything you type into the debugger that recognized as a debugger command is automatically evaluated as zsh code. The way the debugger determines if something is a debugger command is by looking up the first blank-delimited token in a command table and failing to find anything there, in an alias table. Aliases are customizable. (See the help for `alias` and  `unalias`.) Commands are not once they are added. 
+The debugger has a mode where anything you type into the debugger that recognized as a debugger command is automatically evaluated as bash code. The way the debugger determines if something is a debugger command is by looking up the first blank-delimited token in a command table and failing to find anything there, in an alias table. Aliases are customizable. (See the help for `alias` and  `unalias`.) Commands are not once they are added. 

 When this mode is set, if what you type is erroneous the corresponding zsh error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a zsh command. 

&lt;/pre&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rocky Bernstein</dc:creator><pubDate>Sun, 14 Dec 2014 14:55:36 -0000</pubDate><guid>https://sourceforge.netf8b196e1b7cce70dff415bb8f7f4af54c7b6f0ff</guid></item><item><title>Cool Commands modified by Rocky Bernstein</title><link>https://sourceforge.net/p/bashdb/wiki/Cool%2520Commands/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Here we list some of the cooler commands that you might not be familiar with. &lt;/p&gt;
&lt;p&gt;See also:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a class="" href="https://sourceforge.net/p/bashdb/wiki/Evaluating%20the%20current%20source%20line%20before%20it%20runs"&gt;Evaluating the current source line before it runs&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a class="" href="https://sourceforge.net/p/bashdb/wiki/Nested%20Shell"&gt;Nested Shell&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id="auto-evaluation"&gt;Auto Evaluation&lt;/h2&gt;
&lt;p&gt;The debugger has a mode where anything you type into the debugger that recognized as a debugger command is automatically evaluated as zsh code. The way the debugger determines if something is a debugger command is by looking up the first blank-delimited token in a command table and failing to find anything there, in an alias table. Aliases are customizable. (See the help for &lt;code&gt;alias&lt;/code&gt; and  &lt;code&gt;unalias&lt;/code&gt;.) Commands are not once they are added. &lt;/p&gt;
&lt;p&gt;When this mode is set, if what you type is erroneous the corresponding zsh error message is displayed and this sometime might be confusing if what you thought you typed was a debugger command rather than a zsh command. &lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bashdb /etc/init.d/apparmor status
Copyright 2008, 2009, 2010, 2011 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

&lt;span class="o"&gt;(&lt;/span&gt;/etc/init.d/apparmor:35&lt;span class="o"&gt;)&lt;/span&gt;:
. /etc/apparmor/functions
bashdb&amp;lt;1&amp;gt; lis 5
lis 5
** Undefined &lt;span class="nb"&gt;command&lt;/span&gt; &lt;span class="s2"&gt;"lis"&lt;/span&gt;. Try &lt;span class="s2"&gt;"help"&lt;/span&gt;.
bashdb&amp;lt;1&amp;gt; &lt;span class="nb"&gt;set &lt;/span&gt;autoeval on
&lt;span class="nb"&gt;set &lt;/span&gt;autoeval on
Evaluate unrecognized commands is on.
bashdb&amp;lt;2&amp;gt; lis 5
lis 5
/tmp/bashdb_eval_1713:2: &lt;span class="nb"&gt;command &lt;/span&gt;not found: lis
&lt;span class="nv"&gt;$?&lt;/span&gt; is 127
bashdb&amp;lt;3&amp;gt; list 5
list 5
  1:    &lt;span class="c"&gt;#!/bin/sh&lt;/span&gt;
  2:    &lt;span class="c"&gt;# ----------------------------------------------------------------------&lt;/span&gt;
  3:    &lt;span class="c"&gt;#    Copyright (c) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007&lt;/span&gt;
  4:    &lt;span class="c"&gt;#     NOVELL (All rights reserved)&lt;/span&gt;
  5:    &lt;span class="c"&gt;#    Copyright (c) 2008, 2009 Canonical, Ltd.&lt;/span&gt;
  6:    &lt;span class="c"&gt;#&lt;/span&gt;
  7:    &lt;span class="c"&gt;#    This program is free software; you can redistribute it and/or&lt;/span&gt;
  8:    &lt;span class="c"&gt;#    modify it under the terms of version 2 of the GNU General Public&lt;/span&gt;
  9:    &lt;span class="c"&gt;#    License published by the Free Software Foundation.&lt;/span&gt;
 10:    &lt;span class="c"&gt;#&lt;/span&gt;
bashdb&amp;lt;4&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;Because of the above potential confustion and because entering commands to be evaluated can be distructive, this mode is turned off by default.  However most non-novice users prefer to set this mode on.&lt;/p&gt;
&lt;h2 id="auto-list"&gt;Auto list&lt;/h2&gt;
&lt;p&gt;Normally only the source code line to be displayed is listed in stopping in the debugger. However it is possible to automatically list more context automatically on each stop. For this use &lt;code&gt;set autoeval&lt;/code&gt;. &lt;/p&gt;
&lt;p&gt;Here is a sample session:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;bashdb hanoi.sh 
bashdb hanoi.sh 
zsh debugger, bashdb, release 0.07

Copyright 2008, 2009, 2010, 2011 Rocky Bernstein
This is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.

&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:6&lt;span class="o"&gt;)&lt;/span&gt;:
init &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt; &lt;span class="nv"&gt;$tracing&lt;/span&gt; &lt;span class="o"&gt;))&lt;/span&gt; &lt;span class="k"&gt;then &lt;/span&gt;&lt;span class="nv"&gt;_Dbg_set_linetrace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1 &lt;span class="k"&gt;fi&lt;/span&gt; &lt;span class="o"&gt;}&lt;/span&gt;
bashdb&amp;lt;1&amp;gt; &lt;span class="nb"&gt;set &lt;/span&gt;autolist on
&lt;span class="nb"&gt;set &lt;/span&gt;autolist on
Auto run of &lt;span class="s1"&gt;'list'&lt;/span&gt; &lt;span class="nb"&gt;command &lt;/span&gt;is on.
bashdb&amp;lt;2&amp;gt; s
&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:13&lt;span class="o"&gt;)&lt;/span&gt;:
hanoi &lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
    &lt;span class="nb"&gt;typeset&lt;/span&gt; -r &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
    &lt;span class="nb"&gt;typeset&lt;/span&gt; -r &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$3&lt;/span&gt;
    &lt;span class="nb"&gt;typeset&lt;/span&gt; -r c ...
  8:      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;((&lt;/span&gt; &lt;span class="nv"&gt;$tracing&lt;/span&gt; &lt;span class="o"&gt;))&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;  &lt;/span&gt;9:        &lt;span class="nv"&gt;_Dbg_set_linetrace&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;1
 10:      &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;11:    &lt;span class="o"&gt;}&lt;/span&gt;
 12:    
 13: &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; hanoi&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
 14:      &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;n&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$1&lt;/span&gt;
 15:      &lt;span class="c"&gt;# _Dbg_set_trace&lt;/span&gt;
 16:      &lt;span class="nb"&gt;typeset&lt;/span&gt; -r &lt;span class="nv"&gt;a&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
 17:      &lt;span class="nb"&gt;typeset&lt;/span&gt; -r &lt;span class="nv"&gt;b&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$3&lt;/span&gt;
bashdb&amp;lt;3&amp;gt; s
&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:30&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
 25:           hanoi &lt;span class="nv"&gt;$n&lt;/span&gt; &lt;span class="nv"&gt;$c&lt;/span&gt; &lt;span class="nv"&gt;$b&lt;/span&gt; &lt;span class="nv"&gt;$a&lt;/span&gt;
 26:        &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;27:      &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;28:    &lt;span class="o"&gt;}&lt;/span&gt;
 29:    
 30: &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
 31:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
 32:    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;33:      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;34:          &lt;span class="nv"&gt;abs_top_builddir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
bashdb&amp;lt;4&amp;gt; s
&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:31&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
 26:        &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;27:      &lt;span class="k"&gt;fi&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;28:    &lt;span class="o"&gt;}&lt;/span&gt;
 29:    
 30:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
 31: &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
 32:    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;33:      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;34:          &lt;span class="nv"&gt;abs_top_builddir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt;
 35:      &lt;span class="k"&gt;elif&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -z &lt;span class="nv"&gt;$builddir&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;If you want to change the number of context lines use &lt;code&gt;set listsize&lt;/code&gt;:&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;bashdb&amp;lt;5&amp;gt; &lt;span class="nb"&gt;set &lt;/span&gt;listsize 4
bashdb&amp;lt;6&amp;gt; step
&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:32&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;
&lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;    if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;
    &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt;        &lt;/span&gt;&lt;span class="nv"&gt;abs_top_builddir&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nv"&gt;$2&lt;/span&gt; 
     ...
 30:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
 31:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
 32: &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;33:      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
bashdb&amp;lt;7&amp;gt; step
&lt;span class="o"&gt;(&lt;/span&gt;/hanoi.sh:32&lt;span class="o"&gt;)&lt;/span&gt;:
&lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt;
 30:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;max&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;3
 31:    &lt;span class="nb"&gt;typeset&lt;/span&gt; -i &lt;span class="nv"&gt;tracing&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;0
 32: &lt;span class="o"&gt;=&lt;/span&gt;&amp;gt; &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; &lt;span class="s2"&gt;"$1"&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s1"&gt;'trace'&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
&lt;span class="k"&gt; &lt;/span&gt;33:      &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="o"&gt;[[&lt;/span&gt; -n &lt;span class="nv"&gt;$2&lt;/span&gt; &lt;span class="o"&gt;]]&lt;/span&gt; ; &lt;span class="k"&gt;then&lt;/span&gt;
bashdb&amp;lt;9&amp;gt;
&lt;/pre&gt;&lt;/div&gt;
&lt;p&gt;To be continued...&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Rocky Bernstein</dc:creator><pubDate>Sun, 14 Dec 2014 12:01:16 -0000</pubDate><guid>https://sourceforge.net3ef77404961ccf3f1c67c0b6b6d416ebb25f8217</guid></item></channel></rss>