From: Ben Wheeler <[EMAIL PROTECTED]>
> Don't you need to escape the "#" symbol? If you don't, everything
> after it is a comment.
>
> Ben
You mean treated like a comment by the shell?
Well I'm not a unix guy so I can't tell for sure.
If you'd enter the command on the prompt by hand you'd have to
escape it?
You definitely do not need it for Perl.
> At 04:38 PM 7/11/01 +0530, [EMAIL PROTECTED] wrote:
> >@lines = $t->cmd("grep -v # *.rm | awk '{print $1}' ");
There is another problem. Since the command in enclosed in
double quotes it is being interpolated. And the $1 gets replaced by
the first group in the last regular expression. I doubt this is what
you wanted.
Try :
print ("grep -v # *.rm | awk '{print $1}' ");
print "\n";
Do you see?
Either escape the $ :
@lines = $t->cmd("grep -v # *.rm | awk '{print \$1}' ");
or enclose it in single quotes (or better q{}) :
@lines = $t->cmd(q{grep -v # *.rm | awk '{print $1}' });
Jenda
== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ==
: What do people think?
What, do people think? :-)
-- Larry Wall in <[EMAIL PROTECTED]>
_______________________________________________
Perl-Unix-Users mailing list. To unsubscribe go to
http://listserv.ActiveState.com/mailman/subscribe/perl-unix-users