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


Groups > comp.lang.python > #56855 > unrolled thread

Re: Problem calling script with arguments

Started byMichael Speer <knomenet@gmail.com>
First post2013-10-15 13:18 -0400
Last post2013-10-15 13:18 -0400
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#56855 — Re: Problem calling script with arguments

FromMichael Speer <knomenet@gmail.com>
Date2013-10-15 13:18 -0400
SubjectRe: Problem calling script with arguments
Message-ID<mailman.1100.1381857506.18130.python-list@python.org>

[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
>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web