On Wed, Jan 28, 2015 at 6:12 PM, Lex Trotman <
ele...@gmail.com> wrote:
> On 29 January 2015 at 10:08, Bryan Murdock <
bmur...@gmail.com> wrote:
>> On Wed, Jan 28, 2015 at 4:29 PM, Lex Trotman <
ele...@gmail.com> wrote:
>>> On 29 January 2015 at 09:18, Bryan Murdock <
bmur...@gmail.com> wrote:
>>>> If I do this:
>>>>
>>>> run('cat file1 file2 > file3', shell=True)
>>>>
>>>> I get this:
>>>>
>>>> "cat file1 file2 > file3"
>>>>
>>>> strace: cat file1 file2 > file3: command not found
>>>>
>>>> fabricate: 'strace' exited with status 1
>>>>
>>>> If I do this:
>>>>
>>>> run('cat', 'file1', 'file2', '>', 'file3', shell=True)
>>>
>>> Well, thats how you should run all commands, with each argument a
>>> separate parameter to run, see
https://code.google.com/p/fabricate/
>>> example. That way there are no problems with spaces in filenames and
>>> such.
>>
>> Interesting, when I run the cat command as above it doesn't track
>> file3 as an output in the .deps file. When I make a little script
>> that does the cat operation and call that script with the run command
>> it does track file3 as an output. I guess I need to stick with the
>> script solution after all.
>
> Ahh, yeah, the shell is applied at the top level, above strace, so
> strace doesn't see the writes to file3. You could avoid a script by
> running shell explicitly: run('/bin/sh', '-c', 'cat f1 f2 >f3')
Interesting. I haven't tried that with the cat command, but I have
didn't fix anything. Is it the relative paths that are tricking