Statalist


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

Re: st: RE: Tracing dofile execution


From   Eric Booth <[email protected]>
To   [email protected]
Subject   Re: st: RE: Tracing dofile execution
Date   Wed, 10 Feb 2010 09:33:38 -0600

<>

> On Feb 10, 2010, at 2:33 AM, Eric wrote:

>> The "cp" command doesnt append files together before the copy, as is the case in 
>> the DOS version of "copy".  There's probably other *nix commands to do this, but it might be a better
>> idea if you can write them all into the same file from Stata using -file write-.  Or you could add them together
>> first using something similar to "appendfile" (from SSC).

Sure, I mentioned that "cp" couldn't append them together in my posting, but that he might look for another unix command 
(or option for "cp") that would work (The "cp" command I provided was incorrect, but I stated that upfront & was using it 
only as an illustration of how to write the platform specific "if" statements...perhaps I should have just put a placeholder to 
avoid confustion).  It looks like "cat" is that missing unix command, thanks for finding that.

@David:  
I ran your updated version of -dodebug- (1.0.1) that uses the new Reif  approach and it works great  (& I do find 
the macro expansion capabilities useful).  You've got options to turn on hilite and depth in your program, but could I 
suggest that you add the option to turn on the tracenumber when the program runs? I added it in when I was playing with 
-dodebug- and I liked being able to toggle this on/off when needed.

~ Eric

__
Eric A. Booth
Public Policy Research Institute
Texas A&M University
[email protected]
Office: +979.845.6754
Fax: +979.845.0249
http://ppri.tamu.edu


On Feb 10, 2010, at 8:59 AM, Kit Baum wrote:

> <>
> This is not correct Unix syntax (and it does not work on Mac OS X). You cannot include plus signs in a cp command.
> 
> bcvpn13:code baum$ cp one.file+two.file+three.files allfiles2
> cp: one.file+two.file+three.files: No such file or directory
> 
> A common way to do what you are trying to do is
> 
> bcvpn13:code baum$ cat one.file two.file three.file > allfiles
> 
> 'cat' is short for 'concatenate', which implies the desired appending behavior. This will work on all non-Windows OS supported by Stata.
> 
> On Feb 10, 2010, at 2:33 AM, Eric wrote:
> 
>> if "`c(os)'" == "MacOSX" {
>> !cp  "`top'"+"`using'"+"`bottom'" "`c(sysdir_personal)'dotemp.ado" -R
>> *( you'd need to explore the help file for "cp" to see if it could append the files first)
>> }
> 
> 
> Kit Baum   |   Boston College Economics & DIW Berlin   |   http://ideas.repec.org/e/pba1.html
>                              An Introduction to Stata Programming  |   http://www.stata-press.com/books/isp.html
>   An Introduction to Modern Econometrics Using Stata  |   http://www.stata-press.com/books/imeus.html
> 



*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index