LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   syntax error near unexpected token in bash using perl (https://www.linuxquestions.org/questions/programming-9/syntax-error-near-unexpected-token-in-bash-using-perl-563355/)

wjevans_7d1@yahoo.co 06-23-2007 08:08 AM

I just thought of a fourth way.

Maybe everything at your work environment is quite correct. Maybe all you have to do is fix the syntax errors (possibly with the help of my original post in this thread) and it will work.

It's easy, and it's worth a shot, no?

ghostdog74 06-23-2007 09:11 AM

Why is it you need to use an extra sh -c to call perl script, when you can just call the perl script from whatever shell you are in now? maybe i am missing something here.

wjevans_7d1@yahoo.co 06-24-2007 06:21 AM

Quoth ghostdog74:

Quote:

Why is it you need to use an extra sh -c to call perl script, when you can just call the perl script from whatever shell you are in now? maybe i am missing something here.
The answer was given by kambrish in post 14:

Quote:

$exec_info = ginstall_common::execute_backquoted_command(
"perl -pi -e \'print \"TextContents\" if \$\.==13\' \"\/usr\/local\/etc\/stunnel\/stunnel1.conf\"",
);

The command goes like this in the function execute_backquoted_command
Is that correct, kambrish? You can't just bypass execute_backquoted_command() and find some other way to call the perl script?

ghostdog74 06-24-2007 07:23 AM

Quote:

Originally Posted by wjevans_7d1@yahoo.co
Quoth ghostdog74:



The answer was given by kambrish in post 14:



Is that correct, kambrish? You can't just bypass execute_backquoted_command() and find some other way to call the perl script?

my question is: why call sh to call perl. Also in
Quote:

$exec_info = ginstall_common::execute_backquoted_command(
"perl -pi -e \'print \"TextContents\" if \$\.==13\' \"\/usr\/local\/etc\/stunnel\/stunnel1.conf\"",
);
, there is no sh.

wjevans_7d1@yahoo.co 06-25-2007 08:02 AM

I'm assuming that execute_backquoted_command() contains a call to sh.

So. kambrish, can you avoid calling execute_backquoted_command() and call bash directly?

kambrish 06-25-2007 08:23 AM

Well, sorry but i cannot skip calling this function, still will give it a try tomorrow or day after as I got stuck with some other issue too along with this, hence little delay in replying.
Thanks alot for all your support until now. Let me c if I can come up with some option based on your posts.
Regards Ambrish

archtoad6 07-03-2007 12:42 PM

What did you do? -- Is it fixed?


All times are GMT -5. The time now is 06:19 PM.