in reply to Shell Commands executed in perl script
You have quotes inside your quotes. Try the following:
print $sh->ls( qq(-l ./logs/ |grep -v "^d" |grep -v file1 | awk 'NR>1 +{ print \$9}'));
Or indeed you could use q() as you're not doing any variable substitution inside the string.
Update: yes I know it would be better for the OP to have coded this in perl rather than shelling out 4 subprocesses. Sometimes you need to start with where the person is. Spotting the quote nesting is something glaringly obvious to me - a kind of mistake anyone can make in coding, and worth pointing out.
--
wetware hacker
(Qualified NLP Practitioner and Hypnotherapist)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Shell Commands executed in perl script
by msk_0984 (Friar) on May 22, 2007 at 11:43 UTC | |
Re^2: Shell Commands executed in perl script
by Anonymous Monk on May 22, 2007 at 13:24 UTC |
In Section
Seekers of Perl Wisdom