Re: How to expand sudo environment when -E doesn't

2011-10-13 Thread Harry Putnam
Chris Davies writes: [...] >> What can I do to avoid this kind of silliness? What kind of >> environment variable would even tell sudo about bash builtins? > > There isn't one. You can't use bash builtins like that in any > command. Instead, you should consider a construct like this: > > su

Re: How to expand sudo environment when -E doesn't

2011-10-13 Thread Chris Davies
Harry Putnam wrote: > I find sudo to be particularly ill informed at times. > sudo for ii in 1 2 3;do echo $ii;done > bash: syntax error near unexpected token `do' > It doesn't know about bash builtins. Why should it? > Adding the -E flag (preserve environment) doe not help at all. > sud

Re: How to expand sudo environment when -E doesn't

2011-10-13 Thread Darac Marjal
On Thu, Oct 13, 2011 at 03:58:24PM +0100, Chris Davies wrote: > Harry Putnam wrote: > > I find sudo to be particularly ill informed at times. > > > sudo for ii in 1 2 3;do echo $ii;done > > bash: syntax error near unexpected token `do' I suspect the problem here is, perhaps not that sudo does

How to expand sudo environment when -E doesn't

2011-10-13 Thread Harry Putnam
I find sudo to be particularly ill informed at times. For example: Attempting to run a `for' loop as user: for ii in 1 2 3;do echo $ii;done 1 2 3 as sudoer: sudo for ii in 1 2 3;do echo $ii;done bash: syntax error near unexpected token `do' It doesn't know about bash builtins. Adding t