|
List Info
Thread: How to escape $?...
|
|
| How to escape $?... |

|
2006-03-25 08:19:48 |
How to escape sequences like '$?', '?' in command line?
I have a construct like this:
|Xdialog --yesno "really delete???\n%%f" 7 0;
sh -c "if [ $? == 0 ];
then kdesu 'rm -rf %f'; fi"
It works on the last Version of emelfm2, but not on the
newest.
1. There is no '???' in the Xdialog-message, tried
'\?': nothing
2. I had to replace '\n' to '\\n' for a line break,
this works
3. '$?' results in nothing
What can I do?
Thanks, Hans Durast
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| How to escape $?... |

|
2006-03-26 04:17:07 |
On Sat, 25 Mar 2006 09:19:48 +0100
Hans Durast <65644434343 online.de> wrote:
> How to escape sequences like '$?', '?' in command
line?
> I have a construct like this:
>
> |Xdialog --yesno "really delete???\n%%f" 7
0; sh -c "if [ $? == 0 ];
> then kdesu 'rm -rf %f'; fi"
>
> It works on the last Version of emelfm2, but not on the
newest.
> 1. There is no '???' in the Xdialog-message, tried
'\?': nothing
> 2. I had to replace '\n' to '\\n' for a line
break, this works
Someone proposed that escape chars be filtered from
commands. I guess that needs more thought.
> 3. '$?' results in nothing
0.1.6 will treat the ? as a wildcard, and so try to expand
$? into matching itemname(s), which in general would find
nothing.
> What can I do?
apply the following, and rebuild
--- e2_utils.c-original 2006-03-25 22:54:02.000000000 -0500
+++ e2_utils.c 2006-03-25 22:59:00.000000000 -0500
 -1174,4
+1174,6 
if (strchr (arg, '*') == NULL && strchr (arg,
'?') == NULL)
return NULL;
+ if (g_str_has_prefix (arg, "$")) //some shell
or language variables can be ignored
+ return NULL;
path = curr_view->dir;
name = arg;
While we're at it, are there any other special-cases that
we should watch for ?
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| How to escape $?... |

|
2006-03-25 18:05:36 |
|
Thanks for your reply
cpc2.home.net" type="cite">
Someone proposed that escape chars be filtered from commands. I guess that needs more thought.
Oh yes, please think about this "feature".
One of the greatest things in emelfm2 is to put
my own shell commands into a menu, or create
a new button for it.
But if some commands have no function...
I have applied your patch, but the result is not
what I want.
I have tested it with this command line:
|Xdialog --yesno "the\\nresult" 7 0; echo $?
with some variations,
but the result is neither 0 nor 1, it is nothing or '$?'
I think i go back to version 0.1.5
Thanks, Hans Durast
cpc2.home.net" type="cite">
apply the following, and rebuild
--- e2_utils.c-original 2006-03-25 22:54:02.000000000 -0500
+++ e2_utils.c 2006-03-25 22:59:00.000000000 -0500
 -1174,4 +1174,6 
if (strchr (arg, '*') == NULL && strchr (arg, '?') == NULL)
return NULL;
+ if (g_str_has_prefix (arg, "$")) //some shell or language variables can be ignored
+ return NULL;
path = curr_view->dir;
name = arg;
While we're at it, are there any other special-cases that we should watch for ?
|
| How to escape $?... |

|
2006-03-26 15:57:57 |
On Sat, 25 Mar 2006 19:05:36 +0100
Hans Durast <65644434343 online.de> wrote:
> >Someone proposed that escape chars be filtered from
commands. I guess
> >that needs more thought.
> >
> >
> Oh yes, please think about this "feature".
> One of the greatest things in emelfm2 is to put
> my own shell commands into a menu, or create
> a new button for it.
> But if some commands have no function...
>
> I have applied your patch, but the result is not
> what I want.
> I have tested it with this command line:
>
> |Xdialog --yesno "the\\nresult" 7 0; echo
$?
>
> with some variations,
> but the result is neither 0 nor 1, it is nothing or
'$?'
> I think i go back to version 0.1.5
That won't help, for your test-case. emelFM2's command
processor is not a full-blown shell, it doesn't know about
things like $?.
To get access to shell parameters like $?, you need to run
sh -c "Xdialog --yesno "the\\nresult" 7
0; echo $?"
(which runs as expected after applying the patch from last
message).
BTW, if you want to prevent the "\" stripping
in 0.1.6, remove lines 960 to 978 from
.../src/command/e2_command.c
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| How to escape $?... |

|
2006-03-26 12:37:45 |
|
Hello
cpc2.home.net" type="cite">
That won't help, for your test-case. emelFM2's command processor is not a full-blown shell, it doesn't know about things like $?.
To get access to shell parameters like $?, you need to run
sh -c "Xdialog --yesno "the\\nresult" 7 0; echo $?"
(which runs as expected after applying the patch from last message).
BTW, if you want to prevent the "\" stripping in 0.1.6, remove lines 960 to 978 from
.../src/command/e2_command.c
Oh no, i don't like to change the sourcecode.
My solution is to put commands in this manner
to a shell-script and run it with some parameters
from the emelfm2 menu, this works for me.
All done,
thanks, Hans Durast
|
| Missing custom_command |

|
2006-05-06 05:44:37 |
Hello,
I have a little Problem:
There is no menu-entry 'custom command' ('Eigener
Befehl', in my language),
in the drop-down-box of the configuration-menu.
Please help me on Version 0.1.7
thanks, Hans Durast
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-06 13:52:39 |
Hello!
Hans Durast schrieb:
> Hello,
> I have a little Problem:
> There is no menu-entry 'custom command' ('Eigener
Befehl', in my language),
> in the drop-down-box of the configuration-menu.
You can found that in 'Kontextmenü'
> Please help me on Version 0.1.7
>
> thanks, Hans Durast
Regards
Ronny
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-06 14:24:23 |
|
Hi Ronny, thanks for your reply,
but this is not what i mean.
I'm missing 'custom command' in the action row.
Ronny Steiner schrieb:
gmx.de" type="cite">You can found
that in 'Kontextmenü'
Regards
Ronny
|
| Missing custom_command |

|
2006-05-06 14:39:08 |
Hi!
Hans Durast schrieb/wrote:
> Hi Ronny, thanks for your reply,
> but this is not what i mean.
> I'm missing 'custom command' in the action row.
'Custom command' means that you can type any command you
like in the
action row. You can also add your own command to any context
menu (i.e.
to actions or other) by clicking the action row and type
your own
command. 'Custom command' (Eigene Befehle) is only a
heading.
Is that the right answer? Maybe we should write is german
for better
understanding!?
>
>
> Ronny Steiner schrieb:
>> You can found that in 'Kontextmenü'
>> Regards
>> Ronny
>
>
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-06 15:25:28 |
Ronny Steiner schrieb:
> 'Custom command' means that you can type any command
you like in the
> action row. You can also add your own command to any
context menu (i.e.
> to actions or other) by clicking the action row and
type your own
> command. 'Custom command' (Eigene Befehle) is only a
heading.
>
> Is that the right answer? Maybe we should write is
german for better
> understanding!?
Perhaps this is the better way, but one try in english: :-[
A picture says more than 1000 words?
Here is a screenshot,
http://fun-web.net/picture_library/1146928108Bi
ldschirmphoto1.png
You see, there is no menu entry 'Eigener Befehl' or
'custom command'
in the action row and this is the point.
Its not in the mainmenu and not in the submenu 'Befehl'.
It seems, that all other commands are complete.
thanks, Hans Durast
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-06 19:21:36 |
Hello again!
Hans Durast schrieb/wrote:
>
> Perhaps this is the better way, but one try in english:
:-[
> A picture says more than 1000 words?
> Here is a screenshot,
> http://fun-web.net/picture_library/1146928108Bi
ldschirmphoto1.png
>
> You see, there is no menu entry 'Eigener Befehl' or
'custom command'
> in the action row and this is the point.
> Its not in the mainmenu and not in the submenu
'Befehl'.
That's right because the custom commands are not internal
(of emelfm2)
commands. If you want to add the same custom command like in
the context
menu to the toolbar you have to define it again (twice).
Custom commands
have no internal names (maybe custom_command.1) while i.e.
the refresh
button is defined as the internal command
'Fenster.Aktualisieren'.
> It seems, that all other commands are complete.
All other internal commands! For example look at the context
menu
'Aktionen - Kopieren'. It is defined as
'Datei.Kopieren'. And now look
at the toolbar configuration. There is no command
'Aktionen.Kopieren'
because the internal command is 'Datei.Kopieren' and this
item you will
find.
Hope that will help you.
Regards
Ronny
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-13 11:13:49 |
On Sat, 06 May 2006 21:21:36 +0200
Ronny Steiner <sir.steiner gmx.de> wrote:
> Hello again!
>
> Hans Durast schrieb/wrote:
> >
> > Perhaps this is the better way, but one try in
english: :-[
> > A picture says more than 1000 words?
> > Here is a screenshot,
> > http://fun-web.net/picture_library/1146928108Bi
ldschirmphoto1.png
> >
> > You see, there is no menu entry 'Eigener Befehl'
or 'custom command'
> > in the action row and this is the point.
> > Its not in the mainmenu and not in the submenu
'Befehl'.
>
> That's right because the custom commands are not
internal (of emelfm2)
> commands. If you want to add the same custom command
like in the context
> menu to the toolbar you have to define it again
(twice). Custom commands
> have no internal names (maybe custom_command.1) while
i.e. the refresh
> button is defined as the internal command
'Fenster.Aktualisieren'.
>
> > It seems, that all other commands are complete.
>
> All other internal commands! For example look at the
context menu
> 'Aktionen - Kopieren'. It is defined as
'Datei.Kopieren'. And now look
> at the toolbar configuration. There is no command
'Aktionen.Kopieren'
> because the internal command is 'Datei.Kopieren' and
this item you will
> find.
>
> Hope that will help you.
The internal command (aka action) named <custom
command> is not needed any more.
It was necessary to allow user-defined commands to be
provided in the old form of action-list widget, where you
could only select, not enter anything custom, in the command
field.
Now you can enter a command, as well as select from the
actions menu. So just enter the command you want, and forget
<custom command> (though that should still work, if
you happen to have it lying around in a config file
somewhere, and that's why the name still exists in
translation files).
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| Missing custom_command |

|
2006-05-13 06:21:07 |
Oh yeah, great
Tom has understood my "Problem"
So as I understand your answer,
I had to put '<custom command>' (<Eigener
Befehl>) or nothing
into the action row and write my own sh-command right beside
it.
Both works, thank you.
Kind regards, Hans Durast
tpgww onepost.net schrieb:
> The internal command (aka action) named <custom
command> is not needed any more.
>
> It was necessary to allow user-defined commands to be
provided in the old form of action-list widget, where you
could only select, not enter anything custom, in the command
field.
>
> Now you can enter a command, as well as select from the
actions menu. So just enter the command you want, and forget
<custom command> (though that should still work, if
you happen to have it lying around in a config file
somewhere, and that's why the name still exists in
translation files).
>
> Regards
> Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| drag & drop has no function... |

|
2006-08-13 13:44:19 |
...on V0.1.8 + patch to copy files.
The button copy does it.
Kind regards, Hans Durast
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| drag & drop has no function... |

|
2006-08-14 12:57:08 |
On Sun, 13 Aug 2006 15:44:19 +0200
Hans Durast <65644434343 online.de> wrote:
> ...on V0.1.8 + patch to copy files.
> The button copy does it.
Thnaks Hans.
Now fixed. Keep an eye out for a bugfix release soon.
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| No Problems in september? |

|
2006-09-17 17:18:00 |
Very disappointing...
Hi all
But i have one:
it is not possible to change the access rights for more than
one file
marked in emelfm2 0.2.0.
Any solution?
Kind regards, Hans Durast
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| No Problems in september? |

|
2006-09-17 17:37:45 |
Why disappointing, it's actually a good rate
but imho there are more bugs than ever in 0.2.0, this could
also be the
reason...
i haven't noticed your problem yet, but can confirm yet.
the 'apply to
all' button is broken, if you select multiple files and
click ok for
each, then it is ok.
regards, Uwe
On Sun, 2006-09-17 at 19:18 +0200, Hans Durast wrote:
> Very disappointing...
>
> Hi all
> But i have one:
> it is not possible to change the access rights for more
than one file
> marked in emelfm2 0.2.0.
>
> Any solution?
>
> Kind regards, Hans Durast
>
>
>
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| No Problems in september? |

|
2006-09-17 18:58:25 |
Hans Durast wrote:
> it is not possible to change the access rights for more
than one file
> marked in emelfm2 0.2.0.
>
Hmmm, I didn't bang my head on that one. It's good to
report these
things, Tom is quick to fix them.
I have some enhancements I'd like to see:
1): Add edit and edit_with to the context-menu of
executable scripts.
2): Use the current selection for the 'mkdir'
suggestion, over-riding
last creation. In other words if branch-0.2.1 is selected,
suggest
branch-0.2.1++, instead of last-creation++.
---
David Jensen
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| No Problems in september? |

|
2006-09-19 01:58:09 |
On Sun, 17 Sep 2006 19:18:00 +0200
Hans Durast <65644434343 online.de> wrote:
> Very disappointing...
>
> Hi all
> But i have one:
> it is not possible to change the access rights for more
than one file
> marked in emelfm2 0.2.0.
>
> Any solution?
Bug, now fixed, ready for next release.
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
| No Problems in september? |

|
2006-09-19 02:00:02 |
On Sun, 17 Sep 2006 19:37:45 +0200
Uwe Helm <digitalenemy gmail.com> wrote:
> Why disappointing, it's actually a good rate
> but imho there are more bugs than ever in 0.2.0,
Please tell us about them, so they can be fixed.
Regards
Tom
--
Users can unsubscribe from the list by sending email to
emelfm2-request freelists.org with 'unsubscribe' in the
subject field or by logging into the web interface.
|
|
|
|