Harry Putnam <[email protected]> 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.

>  sudo -E for ii in 1 2 3;do echo $ii;done 
>  bash: syntax error near unexpected token `do'

Why should it?


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

    sudo bash -c 'for ii in 1 2 3; do echo $ii; done'

Chris


-- 
To UNSUBSCRIBE, email to [email protected] 
with a subject of "unsubscribe". Trouble? Contact [email protected]
Archive: http://lists.debian.org/[email protected]

Reply via email to