Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 04 Sep 2015, 19:07
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
BashDiff - Bash extended.
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Wed 19 Apr 2006, 09:57    Post subject:  BashDiff - Bash extended.  

Have a look at bashdiff http://freshmeat.net/projects/bashdiff/

I've complied it (I added a patch provided by William) and it works great in Puppy

It adds just about 10K to the original bash but greatly extends the power of bash scripting:

- String handling (strcat, strcpy, strlen, strcmp)
- Array handling
- XML parsing: (expat)
- error checking (try-block)
- Calculations (HP syle rpn calculator)
- GTK UI generation (Way better and cleaner than gtkdialog)
Plus many more features

Once I'm done readying XDG menus package and the network wizard for 1.0.9 I will prepare a package with it... or why wait, just because I'm at the office now and not in linux does not mean that I cannot upload it:

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
MU


Joined: 24 Aug 2005
Posts: 13644
Location: Karlsruhe, Germany

PostPosted: Wed 19 Apr 2006, 10:52    Post subject:  

wow, looks promising.
I currently do some coding in C (Gtk), and think of releasing some widgets in the next days, that can be used in scripts.
Like that one for example:
http://dotpups.de/pics/puppy/dbsetter.jpg

So if someone has a special wish... Smile
Mark
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7456
Location: Perth, Western Australia

PostPosted: Wed 19 Apr 2006, 20:48    Post subject:  

Gee, that looks like my wish-list for Bash!

I'm downloading it right now!
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 20 Apr 2006, 09:34    Post subject:  

Hi Barry,

Yes, pretty impresive. The developer is member of my local LUG and as soon as he made a presentation I was hooked. I've been testing it since.

Please beware of the following email exchange with William:

I had to apply the patch manually (manually inserting the required lines) as the patch as is would not work for me.

Please also note that I disabled all the libraries that don't nativelly come on the LiveCD.

Quote:

> I'm having a problem using it.
>
> The problem is that whenever I enter a command it
> cannot find, it tells me that, but does not return to
> the command line, I must close the console window.
>
> I've compiled bash+william according to William's page
> and using the following configure:
>
> ./configure --disable-postgresql --disable-mysql
> --disable-sqlite --disable-gdbm --disable-libwebserver
>
> It compiled OK, and I can use the new shell with the
> basic functionality.
>
> Have you experienced this problem?

It's not my doing. Smile Glibc is the culprit. You'll see the same
behaviour with the stock Bash, without my patch. It works here with
- gcc-3.3.6
- glibc-2.3.5

If you have older version, then here is patch which Slackware distro
applied...


Code:
--- jobs.c.orig   2005-09-10 12:40:49.000000000 -0700
+++ jobs.c   2005-09-10 12:41:13.000000000 -0700
@@ -2476,6 +2476,7 @@
   PROCESS *child;
   pid_t pid;
   int call_set_current, last_stopped_job, job, children_exited, waitpid_flags;
+  static int wcontinued_not_supported = 0;
 
   call_set_current = children_exited = 0;
   last_stopped_job = NO_JOB;
@@ -2489,7 +2490,15 @@
          : 0;
       if (sigchld || block == 0)
    waitpid_flags |= WNOHANG;
+    retry:
+      if (wcontinued_not_supported)
+       waitpid_flags &= ~WCONTINUED;
       pid = WAITPID (-1, &status, waitpid_flags);
+      if (errno == EINVAL)
+       {
+         wcontinued_not_supported = 1;
+         goto retry;
+       }
 
       /* The check for WNOHANG is to make sure we decrement sigchld only
     if it was non-zero before we called waitpid. */


_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 20 Apr 2006, 10:24    Post subject:  

Oh, I almost forget to mention.

The version I uploaded also has the following patch I sent to William. The code is so clean that It was a breeze to figure it out.

The patch is to allow images on the buttons by adding an "image" attribute to the <button> tag:

Code:
==============================
--- gtk.orig.c  2006-04-11 00:32:57.000000000 -0500
+++ gtk.c       2006-04-11 00:21:13.000000000 -0500
@@ -749,6 +749,9 @@
            if (STREQ (a, "label")) {
                gtk_button_set_label (GTK_BUTTON (w),(gchar *)b);
            }
+           else if (STREQ (a, "image")) {
+               gtk_button_set_image (GTK_BUTTON (w),gtk_image_new_from_file((gchar *)b));
+           }
            else if (STREQ (a, "stock")) {
                gtk_button_set_label (GTK_BUTTON (w),(gchar *)b);
                gtk_button_set_use_stock (GTK_BUTTON(w), TRUE);


William has also identified the following bug
William Park wrote:
> Thanks for the feedback!
>
> I just found a typo, which will result in segfault.
> Try
>
> ( a=123456789; echo ${a|>2}; )
>
> and you'll see either strange character at the end,
> or segmentation
> fault. It's returning unterminated string. Other
> than that, everything
> should work. Smile

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 08 Jun 2006, 14:40    Post subject:  

I talked to William Park and he was quite pleased that bashdiff is in Puppy.

He has some nice improvements planned for the next version.

On top of that, he already included my patch for the image buttons on the GTK extension.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Thu 08 Jun 2006, 17:13    Post subject:  

I can't believe it took me so long to look at this, this is great. Thanks again, Rarsa.

Nathan

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Thu 08 Jun 2006, 17:57    Post subject:  

Nathan,

Please notice that Puppy2 already comes with bash-diff as the default shell.

It does not enable the expat or gtk but it's easy to enable (no recompiling needed).

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
BarryK
Puppy Master


Joined: 09 May 2005
Posts: 7456
Location: Perth, Western Australia

PostPosted: Thu 08 Jun 2006, 22:01    Post subject:  

rarsa,
A web page or wiki page "How to use Bash-diff in Puppy Linux"
would be great! Wink
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 09 Jun 2006, 00:05    Post subject:  

I'll extract the relevant information form William's page.

I will basically remove anything unrelated to bash-diff and write the commands based on puppy's file structure.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
Nathan F


Joined: 08 Jun 2005
Posts: 1760
Location: Wadsworth, OH (occasionally home)

PostPosted: Fri 09 Jun 2006, 03:14    Post subject:  

I'm experimenting with it now, the gtk features are just great. I'm thinking of a lot of uses for the XML functions, too.

Nathan

_________________
Bring on the locusts ...
Back to top
View user's profile Send private message AIM Address Yahoo Messenger MSN Messenger 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15154
Location: Paradox Realm

PostPosted: Fri 09 Jun 2006, 04:13    Post subject:  

Wiki page created - relevant info to add? I will leave to you guys . . .
http://puppylinux.org/wikka/BashDiff

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Sat 17 Jun 2006, 01:50    Post subject:  

BarryK wrote:
rarsa,
A web page or wiki page "How to use Bash-diff in Puppy Linux"
would be great! Wink
Barry,

I've cleaned William's bashdiff page removing the sections that had nothing to do with bash and modifying the commands to match Puppy's file organization.

It has excellent examples on how to use the added functionality.

It is now on the Puppy subversion repository on the following project:

http://svn2.cvsdude.com/puppylinux/puppy-documentation/man-pages/trunk.

_________________
http://rarsa.blogspot.com Covering my eclectic thoughts
http://www.kwlug.org/blog/48 Covering my Linux How-to
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1570s ][ Queries: 12 (0.0227s) ][ GZIP on ]