[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: su user -c



On Thu, Jun 6, 2013 at 9:22 AM, Pol Hallen <deben@fuckaround.org> wrote:
> Hi all :-)
>
> this is the part of my script:
>
> email0=user0@domain0.org;email1=user1@domain1.org;name=user0;username=user1;domainname=domain0;echo
> | mutt -s "test message $name" -b email0 email1
>
> if I run this script of own user, runs correctly
>
> but when (inside the script) I use:
>
> su user -c
> email0=user0@domain0.org;email1=user1@domain1.org;name=user0;username=user1;domainname=domain0;echo
> | mutt -s "test message $name" -b email0 email1

You need to quote the command. su reads just 1 argument after -c and
invokes the sh -c <command>. Example:

guido@solid:~$ su someoneelse -c touch asd
Password:
touch: missing file operand
Try `touch --help' for more information.
guido@solid:~$ su someoneelse -c "touch asd"
Password:
touch: cannot touch `asd': Permission denied

Guido

>
> its does not run
>
> any idea?
>
> is it a problem with ' " charset?
>
> thanks!
>
> Pol
>
>
> --
> To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
> Archive: [🔎] 51B07EE9.8020406@fuckaround.org">http://lists.debian.org/[🔎] 51B07EE9.8020406@fuckaround.org
>


Reply to: