Am 09.08.2013 05:47, schrieb David:
On 9 August 2013 14:11, Adam Mercer ramer...@gmail.com wrote:
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
[...]
At a quick glance, I have a couple of suggestions.
command
On Thu, Aug 8, 2013 at 11:47 PM, David bouncingc...@gmail.com wrote:
At a quick glance, I have a couple of suggestions.
command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file]
sudo doesn't work like this. It doesn't read from standard input. You
need to supply the command as an
On Fri, Aug 9, 2013 at 2:21 PM, Adam Mercer ramer...@gmail.com wrote:
command=echo -n %s | sudo tee %s /dev/null % (channel, config_file)
You shouldn't need to use 'echo' here. Just provide tee with the text
on its standard input, and don't bother with the pipe at all.
ChrisA
--
Op 09-08-13 15:29, Chris Angelico schreef:
On Fri, Aug 9, 2013 at 2:21 PM, Adam Mercer ramer...@gmail.com wrote:
command=echo -n %s | sudo tee %s /dev/null % (channel, config_file)
You shouldn't need to use 'echo' here. Just provide tee with the text
on its standard input, and don't bother
On Fri, Aug 9, 2013 at 8:29 AM, Chris Angelico ros...@gmail.com wrote:
You shouldn't need to use 'echo' here. Just provide tee with the text
on its standard input, and don't bother with the pipe at all.
Thanks, that's much better!
Cheers
Adam
--
On Fri, Aug 9, 2013 at 8:42 AM, Antoon Pardon
antoon.par...@rece.vub.ac.be wrote:
That is probably beside the point. I suspect Adam is just giving a
minimal example to show the kind of thing he is trying to do.
Nit picking the specific example instead of advising on the problem
is likely to
Op 09-08-13 06:11, Adam Mercer schreef:
Hi
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
channel = 'stable'
config_file = '/opt/ldg/etc/channel.conf'
command = ['echo', '-n', channel, '|', 'sudo', 'tee',
On Fri, Aug 9, 2013 at 2:50 PM, Adam Mercer ramer...@gmail.com wrote:
On Fri, Aug 9, 2013 at 8:42 AM, Antoon Pardon
antoon.par...@rece.vub.ac.be wrote:
That is probably beside the point. I suspect Adam is just giving a
minimal example to show the kind of thing he is trying to do.
Nit
On 9 August 2013 23:21, Adam Mercer ramer...@gmail.com wrote:
On Thu, Aug 8, 2013 at 11:47 PM, David bouncingc...@gmail.com wrote:
At a quick glance, I have a couple of suggestions.
command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file]
sudo doesn't work like this. It doesn't
On Thu, 08 Aug 2013 23:11:09 -0500, Adam Mercer wrote:
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file]
You can't create a pipeline like this. All
On Fri, 09 Aug 2013 21:12:20 +0100, Nobody wrote:
Try:
command = ['sudo', 'tee', config_file]
p = subprocess.Popen(command, stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
out, _ = p.communicate('channel')
Oops; you also need stdin=subprocess.PIPE.
--
Hi
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
channel = 'stable'
config_file = '/opt/ldg/etc/channel.conf'
command = ['echo', '-n', channel, '|', 'sudo', 'tee', config_file]
p = subprocess.Popen(command,
On Thu, 08 Aug 2013 23:11:09 -0500, Adam Mercer wrote:
Hi
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
channel = 'stable'
config_file = '/opt/ldg/etc/channel.conf'
command = ['echo', '-n', channel, '|',
On 9 August 2013 14:11, Adam Mercer ramer...@gmail.com wrote:
I'm trying to write a script that writes some content to a file root
through sudo, but it's not working at all. I am using:
[...]
At a quick glance, I have a couple of suggestions.
command = ['echo', '-n', channel, '|', 'sudo',
14 matches
Mail list logo