Re: How to escape $?...

On Sat, 25 Mar 2006 19:05:36 +0100
Hans Durast <65644434343@xxxxxxxxx> 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@xxxxxxxxxxxxx with 'unsubscribe' in the subject field or by 
logging into the web interface.

Other related posts: