in reply to Using system command not able to run though the script
Hi chopraa,
Please use <code> tags to format your post, see e.g. How do I post a question effectively?
When you write:
system("simple_pin_$thost.pl $thost | findstr \n "2016 TTL timed" >> + ping_$thost.txt" );
The quotes after findstr are ending the Perl string, and Perl expects to see an operator there. Escape them with \, or use a different quoting construct:
system("simple_pin_$thost.pl $thost | findstr \n \"2016 TTL timed\" +>> ping_$thost.txt" ); system(qq{simple_pin_$thost.pl $thost | findstr \n "2016 TTL timed" +>> ping_$thost.txt});
See also Quote Like Operators.
Hope this helps,
-- Hauke D
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Using system command not able to run though the script
by chopraa (Initiate) on Sep 08, 2016 at 06:05 UTC | |
by haukex (Archbishop) on Sep 08, 2016 at 07:30 UTC |