[sudo-users] sudo and shell scripts.

Gary.Haden at saga.co.uk Gary.Haden at saga.co.uk
Fri Apr 12 07:18:08 MDT 2013


Hi,

There is a shebang in there but not at the top, so we'll move it to the
top. However both root, and the user we are running sudo as have korn shell
by default so the only shell i'd expect to run would be ksh.

But we'll change the shebang and see what happens.

Thanks for your advice.

Gary.


                                                                       
             Vitezslav Cizek                                           
             <vcizek at suse.cz>                                          
                                                                        To
             12/04/2013 11:22          Gary.Haden at saga.co.uk           
                                                                        cc
                                       sudo-users at sudo.ws,             
                                       Clifford.Foster at saga.co.uk      
                                                                   Subject
                                       Re: [sudo-users] sudo and shell 
                                       scripts.                        
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       
                                                                       




Hello,
* Dne Pátek 12. duben 2013, 09:13:40 [CEST] Gary.Haden at saga.co.uk napsal:
>
> Hi,
>
> We have a script that runs as root fine but when we run as another user
and
> - sudo -u root <script> we get -
>
> /saga/bin/env_create/createTIAUser.shl: syntax error at line 61:
> `DBUSERNAME=$'
> unexpected
>
> Line 61 is DBUSERNAME=$(echo $DBUSERNAME | tr '[a-z]' '[A-Z]')
>
Doesn't have the root user a different shell?
For example, bourne shell doesn't support $(), I think.
Do you have a shebang at the beginning of your script?

--
Vita Cizek
(See attached file: signature.asc)

Please consider the environment before printing this email
The opinions expressed in this e-mail are those of the individual and not necessarily the company. This e-mail and attachment[s] are confidential to the sender and are solely for use by the intended recipient.

Saga Services Limited: Company Registration No. 732602
Saga Publishing Limited: Company Registration No. 2152564
The above companies are wholly owned subsidiaries of Saga Group Limited.

Saga Holidays is a registered trading name of Acromas Holidays Limited: Company Registration No. 2174052
Saga Shipping is a registered trading name of Acromas Shipping Limited: Company Registration No. 3267858
Saga Personal Finance is a registered trading name of Acromas Financial Services Limited: Company Registration No. 3023493

Saga Group Limited: Company Registration No. 638891
All companies registered at: Enbrook Park, Sandgate, Folkestone, Kent CT20 3SE
Saga Charitable Trust is a UK registered charity No. 291991

Saga Services Limited is authorised and regulated by the Financial Services Authority.
Acromas Financial Services Limited is authorised and regulated by the Financial Services Authority.
Acromas Holidays Limited is an appointed representative of Automobile Association Insurance Services Limited which is authorised and regulated by the Financial Services Authority.
Acromas Insurance Company Limited is authorised by the Financial Services Commission, Gibraltar.

This e-mail and attachment[s] has been scanned for the presence of computer viruses. Saga accept no responsibility for computer viruses once this e-mail has been transmitted.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/octet-stream
Size: 853 bytes
Desc: not available
URL: </pipermail/sudo-users/attachments/20130412/93e41cdb/attachment.obj>


More information about the sudo-users mailing list