Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: winexec on Stata for Linux


From   [email protected]
To   [email protected]
Subject   Re: st: winexec on Stata for Linux
Date   Fri, 19 Nov 2010 14:14:33 +0100

Alan Riley wrote:
> Ulrich Kohler ([email protected]) is trying to launch another
> program from within Stata for Linux using the -winexec- command.
> He is trying to pass a filename containing a space as an argument
> to that program and is receiving an error:
>
>> . sysuse auto
>> . sc weight mpg
>> . graph export foo.eps, replace
>> ...
>> . copy "foo.eps"  "fo o.eps"
>>
>> -winexec- seem to be not able to open the file. I tried:
>>
>> . winexec xdg-open fo o.eps
>> . winexec xdg-open "fo o.eps"
>> . winexec xdg-open fo\ o.eps
>> . winexec xdg-open 'fo o.eps'
>> ...
>>
>> but non of these produced any output at all (i.e. no error messages, no
>> messages from the shell, nor any window popping up; just the Stata
>> prompt.).
>> ...
>
> What Uli would like to do is escape the space in the filename.  His
> guess to type
>
>     . winexec xdg-open fo\ o.eps
>
> was a good one, as \ is the character in Unix/Linux to escape a space
> or other special character.
>
> However, -winexec- does not currently allow spaces to be escaped.  It
> should, and this will be fixed in a future update.
>
> In the meantime, Uli can work around this by using a standard
> shell command, directing its output to /dev/null, and running it
> in the background.  In this way the command will return control
> immediately to Stata.
>
> Depending on whether Uli is using bash, tcsh, or some other shell in
> Linux, one of the following two commands should work from within Stata:
>
>    . shell xdg-open fo\ o.eps > /dev/null 2>&1 &
>
> or
>
>    . shell xdg-open fo\ o.eps >& /dev/null &


Thanks, Alan. Both commands worked on my system. In addition

. shell xdg-open "fo o.eps" >& /dev/null &

also works.

Regards
Uli


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index