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


Groups > comp.lang.python > #42490

Re: os.system() with imbeded quotes on centos

References <0c9717ca-52dd-49ce-8102-e1432883858a@googlegroups.com>
Date 2013-04-02 06:33 +1100
Subject Re: os.system() with imbeded quotes on centos
From Chris Angelico <rosuav@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.13.1364844794.17481.python-list@python.org> (permalink)

Show all headers | View raw


On Tue, Apr 2, 2013 at 6:22 AM,  <cevyne@gmail.com> wrote:
> var1 = 'lynx -dump http://' + someip + '/cgi-bin/xxxx.log&.submit=+++Go%21+++  > junk'
> lynx -dump 'http://192.168.01.01/cgi-bin/xxxx.log&.submit=+++Go%21+++  > junk'


The problem is the &, which splits the command. Note how your manual
execution puts single quotes around just the URL; in the other
version, you're not doing that. (Though I'm not entirely sure why your
> junk is inside the quotes - is that an error?) Try this:

var1 = 'lynx -dump "http://' + someip +
'/cgi-bin/xxxx.log&.submit=+++Go%21+++"  > junk'

ChrisA

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


Thread

os.system() with imbeded quotes on centos cevyne@gmail.com - 2013-04-01 12:22 -0700
  Re: os.system() with imbeded quotes on centos Chris Angelico <rosuav@gmail.com> - 2013-04-02 06:33 +1100
  Re: os.system() with imbeded quotes on centos John Gordon <gordon@panix.com> - 2013-04-01 20:26 +0000
    Re: os.system() with imbeded quotes on centos Cameron Simpson <cs@zip.com.au> - 2013-04-06 09:00 +1100
    Re: os.system() with imbeded quotes on centos Chris Rebert <clp2@rebertia.com> - 2013-04-05 16:36 -0700

csiph-web