Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Shell


From   Neil Shephard <[email protected]>
To   [email protected]
Subject   Re: st: Shell
Date   Fri, 6 May 2005 19:21:00 +0100

On 5/6/05, Nick Cox <[email protected]> wrote:
> I guess you need to try to fool the parser
> by, as it were, smuggling your slash through
> customs without it being spotted.
> 
> I'd try
> 
> local slash "/"
> 
> ...
> 
> ! rm ${temp}`slash'*.*
> 
> in the hope that the splitting off of
> comments precedes the interpretation of
> the local macro.
> 
Excellent, that works a treat, Stata does indeed appear to parse for
comments before assessing the contents of the macro.  Have added that
to my profile.do as a global macro so that it will always be
available....

profile.do
<snip>
global SLASH "/"
</snip>

. di "$SLASH"
/

...it works perfectly in the sample do-file as shown in the previous posts.

Many thanks Nick,

Neil

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index