Coder Social home page Coder Social logo

Comments (8)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
This bug is very old ...
https://bugs.launchpad.net/ubuntu/+source/gtkdialog/+bug/517065
François

Original comment by [email protected] on 13 Aug 2011 at 11:04

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
I have left thunor a private message on Murg-linux.com/puppy concerning this 
issue as I did a little rewrite of the submitted script and it works just fine 
for me.
[email protected]  That is 8-bit on the Puppy forum. 

Original comment by [email protected] on 14 Aug 2011 at 9:08

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
If frafas changes the line date > /tmp/date
to echo $ENTRY_DATE > /tmp/date
and the line <input>cat /tmp/date</input>
to <input>date</input>
His example will run fine.
The main reason is that the date command does not accept any parameters and so 
is attempting to see the "> /tmp/date" as a parameter.
That is the best I can explain it.

Original comment by [email protected] on 15 Aug 2011 at 2:15

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
Yess :)
solved "export -f" are ok
use this:
<action>exec $SHELL -c 'now'</action>

Exemple:


#!/bin/bash
function now () {
date > /tmp/date
}
export -f now
export script='<vbox>
<entry>
<variable>ENTRY_DATE</variable>
<input>cat /tmp/date</input>
</entry>
<button>
<label>Refresh</label>
<action>exec $SHELL -c 'now'</action>
<action>refresh:ENTRY_DATE</action>
</button>
</vbox>'
gtkdialog3  -p script
exit 0

Original comment by [email protected] on 16 Aug 2011 at 10:14

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
Hi

Firstly I've been busy so sorry for the delay. I saw the private message from 
8-bit but had absolutely no idea what he was talking about since the subject 
said "Issue 23" when this is issue 24 :D

That "bashims" issue on launchpad was fixed months ago.

I found this at https://wiki.ubuntu.com/DashAsBinSh :

function

The function builtin is a bashism, and can almost always simply be removed. If 
you remove it, make sure that there are parentheses after the function name. A 
function definition in POSIX shell looks like this:

function_name () {
    function body
}

So, possibly you must remove "function". I have seen this reported elsewhere so 
I will avoid using it in the future.

Regards,
Thunor

Original comment by [email protected] on 16 Aug 2011 at 3:27

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
thunor,
  Sorry for the confusion in my PM.  When I realized the issue was not the right one and went to edit it, you had already got the PM.

frafas, 
  If you want your script to show the date and create the /tmp/date file on starting, just add the line $SHELL -c 'now' between the 2 export lines.
And thank you for showing me another way to execute an external command from an 
<action> line.

Original comment by [email protected] on 16 Aug 2011 at 3:55

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024
Right, so the conclusion is that the "function" keyword and "export -f 
funcname" aren't supported by dash and that dash is used as the subshell on 
Ubuntu and as the C system() function executes /bin/sh, if that doesn't point 
to bash you'll need to use <action>bash -c funcname</action> or something along 
those lines (<input> commands too).

Anyway, since C's POSIX system() function executes /bin/sh, this really should 
be something to address within the shell script and Gtkdialog XML structure. I 
could create a Gtkdialog command-line argument so that the command passed to 
system() is prepended with "bash -c " or whatever the user supplies, but then 
this can be managed just as effectively from the shell script, example:

EXECBASH="bash -c"
...
<action>$EXECBASH funcname</action>

Original comment by [email protected] on 22 Aug 2011 at 11:18

  • Changed state: Done

from gtkdialog.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 4, 2024

Original comment by [email protected] on 6 Sep 2011 at 11:20

  • Added labels: 8-bit

from gtkdialog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.