using strict and warning gives me this error:-
Variable "$FILE" is not imported at NativeUIAutomationScript.pl line 136.
Variable "$FILE" is not imported at NativeUIAutomationScript.pl line 136.
I am not really sure How to use interpolation in this function.
| [reply] |
| [reply] |
perfect!! Worked for me.. Thanks, PR
| [reply] |
print FILE " [[ -f \"$FILE\" ]] && grep -q \"$STRING\" \"$FILE\" && echo \"DB Installation is completed\" && break\n";
$FILE and $STRING appear in a Perl double-quoted string. Perl will try to interpolate these Perl variables into the string, but you really intend them for the shell. In order to protect them from Perl interpolation, escape them with a \ (backslash) (as afoken has written). So the statement would look something like (untested)
print FILE " [[ -f \"\$FILE\" ]] && grep -q \"\$STRING\" \"\$FILE\" && echo \"DB Installation is completed\" && break\n";
or maybe, since you don't really seem to need Perl interpolation at all in this statement,
print FILE ' [[ -f "$FILE" ]] && grep -q "$STRING" "$FILE" && echo "DB Installation is completed" && break', "\n";
(or use a here-doc as kcott suggested).
Give a man a fish: <%-{-{-{-<
| [reply] [d/l] [select] |