Comments (8)
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.
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.
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.
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.
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.
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.
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.
Original comment by [email protected]
on 6 Sep 2011 at 11:20
- Added labels: 8-bit
from gtkdialog.
Related Issues (20)
- Initially hidden widgets can leave artifacts depending on widget HOT 1
- Connect-up button-press and button-release to the comboboxentry entry child widget HOT 1
- Save tree widget data complete rather than just the exported column HOT 2
- Save selection on TREE widget HOT 4
- Progress bar pulse function HOT 2
- Tree selected-row(s) tag HOT 1
- Using arbitrary images on trees
- Change variable from shell
- String length of input file in tree widget
- stock icons with ltr and rtl versions do not work correctly in the window tag
- treeview should not temper data when saving
- variable in edit display HOT 2
- threading
- splitter like feature
- Option to set the GTK floating hint on dialog HOT 1
- Clearify the meaning of function in widget reference
- Attempt to unlock mutex that was not locked HOT 6
- Installing gtkdialog on Solaris 10
- Can this project be compiled with gtk3?
- How can I purge a broken install from Ubuntu 14.04 64bit
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gtkdialog.