Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #33268

Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?

From Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
Newsgroups comp.lang.python
Subject Re: how to simulate tar filename substitution across piped subprocess.Popen() calls?
Date 2012-11-13 22:36 +0100
Organization A newly installed InterNetNews server
Message-ID <k7uehf$8iq$1@r03.glglgl.gl> (permalink)
References (2 earlier) <5b39febc-fbb9-4d8e-b331-0401e78d2b7f@m13g2000vbd.googlegroups.com> <fdc89c1f-d0da-4fd3-8576-3cd7c94cba89@k21g2000vbj.googlegroups.com> <50a12560$0$6972$e4fe514c@news2.news.xs4all.nl> <b4f250bb-94da-4ce2-9b30-d40a41adb570@k6g2000vbr.googlegroups.com> <50a1402d$0$6947$e4fe514c@news2.news.xs4all.nl>

Show all headers | View raw


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 break if there are single quotes in the file name.

And if you do mydir_q = mydir.replace("'", "'\\''") and use mydir_q, you 
should be safe...


Thomas

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-08 10:05 -0800
  Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Hans Mulder <hansmu@xs4all.nl> - 2012-11-09 02:12 +0100
    Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-12 04:55 -0800
      Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-12 07:36 -0800
        Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Hans Mulder <hansmu@xs4all.nl> - 2012-11-12 17:35 +0100
          Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-12 09:22 -0800
            Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Hans Mulder <hansmu@xs4all.nl> - 2012-11-12 19:30 +0100
              Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-12 13:43 -0800
              Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-11-13 22:36 +0100
                Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Hans Mulder <hansmu@xs4all.nl> - 2012-11-14 09:22 +0100
                Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-18 15:17 -0800
    Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2012-11-13 19:52 +0100
  Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? Rebelo <puntabluda@gmail.com> - 2012-11-12 08:58 -0800
    Re: how to simulate tar filename substitution across piped subprocess.Popen() calls? jkn <jkn_gg@nicorp.f9.co.uk> - 2012-11-12 09:25 -0800

csiph-web