Hi Hans
[...]
>
>
> However, once he does that, it's simpler to cut out xargs and invoke
>
> "sh" directly. Or even cut out "sh" and "test" and instead use
>
> os.path.isfile and then call md5sum directly. And once he does that,
>
> he no longer needs to worry about single quotes.
>
Yes i
On 13/11/12 22:36:47, Thomas Rachel wrote:
> Am 12.11.2012 19:30 schrieb Hans Mulder:
>
>> This will break if there are spaces in the file name, or other
>> characters meaningful to the shell. If you change if to
>>
>> xargsproc.append("test -f '%s/{}'&& md5sum '%s/{}'"
>>
Am 12.11.2012 19:30 schrieb Hans Mulder:
This will break if there are spaces in the file name, or other
characters meaningful to the shell. If you change if to
xargsproc.append("test -f '%s/{}'&& md5sum '%s/{}'"
% (mydir, mydir))
, then it will only bre
Am 09.11.2012 02:12 schrieb Hans Mulder:
That's what 'xargs' will do for you. All you need to do, is invoke
xargs with arguments containing '{}'. I.e., something like:
cmd1 = ['tar', '-czvf', 'myfile.tgz', '-c', mydir, 'mysubdir']
first_process = subprocess.Popen(cmd1, stdout=subprocess.PIPE)
Hi Hans
[...]
>
> > xargsproc.append("test -f %s/{} && md5sum %s/{}" % (mydir,
> > mydir))
>
> This will break if there are spaces in the file name, or other
> characters meaningful to the shell. If you change if to
>
> xargsproc.append("test -f '%s/{}' && md5sum '%s/{}'"
>
On 12/11/12 18:22:44, jkn wrote:
> Hi Hans
>
> On Nov 12, 4:36 pm, Hans Mulder wrote:
>> On 12/11/12 16:36:58, jkn wrote:
>>
>>
>>
>>
>>
>>
>>
>>
>>
>>> slight followup ...
>>
>>> I have made some progress; for now I'm using subprocess.communicate to
>>> read the output from the first subprocess,
Hi Hans
On Nov 12, 4:36 pm, Hans Mulder wrote:
> On 12/11/12 16:36:58, jkn wrote:
>
>
>
>
>
>
>
>
>
> > slight followup ...
>
> > I have made some progress; for now I'm using subprocess.communicate to
> > read the output from the first subprocess, then writing it into the
> > secodn subprocess. T
On Nov 12, 4:58 pm, Rebelo wrote:
> Dana četvrtak, 8. studenoga 2012. 19:05:12 UTC+1, korisnik jkn napisao je:
>
> > Hi All
>
> > i am trying to build up a set of subprocess.Ponen calls to
>
> > replicate the effect of a horribly long shell command. I'm not clear
>
> > how I can do one part of
Dana četvrtak, 8. studenoga 2012. 19:05:12 UTC+1, korisnik jkn napisao je:
> Hi All
>
> i am trying to build up a set of subprocess.Ponen calls to
>
> replicate the effect of a horribly long shell command. I'm not clear
>
> how I can do one part of this and wonder if anyone can advise. I'm o
On 12/11/12 16:36:58, jkn wrote:
> slight followup ...
>
> I have made some progress; for now I'm using subprocess.communicate to
> read the output from the first subprocess, then writing it into the
> secodn subprocess. This way I at least get to see what is
> happening ...
>
> The reason 'we' w
slight followup ...
I have made some progress; for now I'm using subprocess.communicate to
read the output from the first subprocess, then writing it into the
secodn subprocess. This way I at least get to see what is
happening ...
The reason 'we' weren't seeing any output from the second call (th
Hi Hans
thanks a lot for your reply:
> That's what 'xargs' will do for you. All you need to do, is invoke
> xargs with arguments containing '{}'. I.e., something like:
>
> cmd1 = ['tar', '-czvf', 'myfile.tgz', '-c', mydir, 'mysubdir']
> first_process = subprocess.Popen(cmd1, stdout=subproces
On 8/11/12 19:05:11, jkn wrote:
> Hi All
> i am trying to build up a set of subprocess.Ponen calls to
> replicate the effect of a horribly long shell command. I'm not clear
> how I can do one part of this and wonder if anyone can advise. I'm on
> Linux, fairly obviously.
>
> I have a command w
Hi All
i am trying to build up a set of subprocess.Ponen calls to
replicate the effect of a horribly long shell command. I'm not clear
how I can do one part of this and wonder if anyone can advise. I'm on
Linux, fairly obviously.
I have a command which (simplified) is a tar -c command piped th
14 matches
Mail list logo