perl197 has asked for the wisdom of the Perl Monks concerning the following question:
Hi all. I have a production environment that requires the use of sudo to execute perl scripts by multiple users. (emulating a production account, not root) A perl script accepts a where clause as an input parameter. I.e, sudo myperlscript.pl -cs CONNECTIONSTRING -w "fieldvalue in ('111','222')" In myperlscript.pl, w is defined as string ("w=s" => \$where_condition) However if printing $where_condition, the response is simply fieldvalue with the rest of the string stripped off after the first space. This causes an error when executing the combined sql statement. My query to the Monks community; Is there an escape sequence or quote combination you can recommend to allow the entire string to be passed to the variable? I can enter the where condition to and read from a file, but would like to solve this riddle with a less cumbersome work around. Any suggestions are welcome.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: sudo ignoring string entry after first space encountered (ssh)
by tye (Sage) on Apr 14, 2015 at 22:38 UTC | |
|
Re: sudo ignoring string entry after first space encountered
by fishmonger (Chaplain) on Apr 14, 2015 at 21:26 UTC | |
by perl197 (Novice) on Apr 14, 2015 at 23:17 UTC | |
by tye (Sage) on Apr 15, 2015 at 03:08 UTC | |
by perl197 (Novice) on Apr 15, 2015 at 17:01 UTC | |
by tye (Sage) on Apr 16, 2015 at 03:08 UTC | |
by RonW (Parson) on Apr 15, 2015 at 19:49 UTC | |
|
Re: sudo ignoring string entry after first space encountered
by RonW (Parson) on Apr 15, 2015 at 19:44 UTC |