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


Groups > comp.lang.python > #56855

Re: Problem calling script with arguments

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!xlned.com!feeder1.xlned.com!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail
Return-Path <knome.net@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'skip:[ 20': 0.04; 'interpreter': 0.05; 'skip:\xa0 30': 0.05; 'arguments': 0.09; 'output,': 0.09; 'skip:$ 30': 0.09; 'skip:/ 10': 0.09; 'strings.': 0.09; 'subject:script': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '1:13': 0.16; 'adjacent': 0.16; 'comma,': 0.16; 'proc': 0.16; 'right:': 0.16; 'subject:Problem': 0.16; 'sender:addr:gmail.com': 0.17; 'wrote:': 0.18; 'help.': 0.21; 'input': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'source': 0.25; 'script': 0.25; '&gt;': 0.26; '15,': 0.26; 'skip:" 20': 0.27; 'header:In-Reply-To:1': 0.27; '8bit%:3': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; '&quot;': 0.31; 'perl': 0.31; 'file': 0.32; 'thanks!': 0.32; 'open': 0.33; 'url:python': 0.33; 'skip:# 10': 0.33; 'skip:& 30': 0.33; 'subject:with': 0.35; "can't": 0.35; 'something': 0.35; 'received:google.com': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'skip:& 10': 0.38; 'skip:[ 10': 0.38; 'pm,': 0.38; 'skip:& 20': 0.39; 'does': 0.39; 'skip:p 20': 0.39; 'url:mail': 0.40; 'how': 0.40; 'read': 0.60; "you're": 0.61; 'such': 0.63; 'florian': 0.84; '2013': 0.98
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=TU5a6aTLKQ+a0vKg0K1oBiczKZhXw5kbL0j27tGR6gM=; b=dwC8PweUiIacho24DJRRfFx3Oie9hNzLHXE7sYtF/4BptpVyM2Z6YbtQcLNiR+OSlj Oe89Hrh36lxv5Ee0sZHK2T2kfKbdaGo+RLW3bCMvULxzgfhvLLkBerefJmyeBtHhF9yq 4OGewk4dJiRNOfnnZGlosZvrDclzb+EQ9Y7aSbrZAwAF2GaVECTBy8PZVQAaKOQwA7K8 elnAeZ4cHZZrq4nzh7JN9ID4yzkibQcgLi/yW5i/r/cG6c+9zMzUegPFghuvdnPf5++z AjjFZpUsIAocrG5JSX0lL+6o8gPhPzBypc8cVaWBn2RXZpC6ktLjQ0h4SD42Xikge80G j3GQ==
MIME-Version 1.0
X-Received by 10.182.131.196 with SMTP id oo4mr3831517obb.50.1381857497895; Tue, 15 Oct 2013 10:18:17 -0700 (PDT)
Sender knome.net@gmail.com
In-Reply-To <1733191.dIe2MlMTjU@horus>
References <1733191.dIe2MlMTjU@horus>
Date Tue, 15 Oct 2013 13:18:17 -0400
X-Google-Sender-Auth cb-JL3dC4u-MB71FcCtFZ2bDVxw
Subject Re: Problem calling script with arguments
From Michael Speer <knomenet@gmail.com>
To Florian Lindner <mailinglists@xgm.de>
Content-Type multipart/alternative; boundary=001a11c1f6d64ad86204e8cac520
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.1100.1381857506.18130.python-list@python.org> (permalink)
Lines 100
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1381857506 news.xs4all.nl 15958 [2001:888:2000:d::a6]:51778
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:56855

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

>  "/usr/sbin/ftpasswd" "--hash"

You're missing a comma, and python automatically concatenates adjacent
strings.


On Tue, Oct 15, 2013 at 1:13 PM, Florian Lindner <mailinglists@xgm.de>wrote:

> Hello,
>
> I have a 3rd party perl script:
>
>  head -n 1 /usr/sbin/ftpasswd
> #!/usr/bin/perl
>
> I want to write data to stdin and read from stdout:
>
> proc = Popen( ["/usr/bin/perl", "/usr/sbin/ftpasswd" "--hash", "--stdin"],
> stdout=PIPE, stdin=PIPE)
>
> output, input = proc.communicate(pwd)
> return output.strip()
>
> Since pwd comes from a non-trusted source I don't want to use shell=True.
>
> The arguments to the perl interpreter do not seem to right:
>
> Can't open perl script "/usr/sbin/ftpasswd--hash": No such file or
> directory
>
> Adding a leading " " to "--hash" does not help.
>
> How can I use that script and achieve something like
>
> # echo "123" | ftpasswd --hash --stdin
> ftpasswd: $1$8BuLAqCl$y/URBN/OCSLsKtnu8nFHH0
>
> Thanks!
>
> Florian
> --
> https://mail.python.org/mailman/listinfo/python-list
>

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


Thread

Re: Problem calling script with arguments Michael Speer <knomenet@gmail.com> - 2013-10-15 13:18 -0400

csiph-web