I have come across a bit of trouble with making a system call that involves a semicolon. I am doing a backtick system call in the following fashion:
my $output = `/usr/sbin/ubsetenv $currParam $formValue`;
$currParam is the name of the parameter and $formValue is the value to set the parameter to.
It works fine when $formValue doesn't have any semicolons, but when I put in an escaped semicolon (\;) to be used as the argument, it fails with no output. Note: semicolon is escaped for the purpose of the shell script, not perl.
An example input that causes it to fail is:
boot0\;boot1
I have verified that the input from the form is making it to the parsing script intact and have tried storing it to a variable first and viewing the command before executing the command with backticks around the variable. It appears that everything is making it fine up until the backtick command is called, at which point something happens causing it to fail.
Is there something weird about the use of backticks with semicolons that I have missed? Does anyone have any suggestions? Any help would be greatly appreciated.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.