Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Re: Re: Re: Grabbing tokens

by Skeeve (Parson)
on May 14, 2003 at 13:03 UTC ( [id://258062]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Re: Grabbing tokens
in thread Grabbing tokens

Not here!
$ ./p1 `./testers.sh`:From Perl Not BASH Script $
I think you don't know what thos `` mean! In your testers.sh I see:
`/bin/cp /wantstats.sh /newstats.sh`
Luckily /bin/cp doesn't have any STDOUTput! Just go ahead and enter:
`echo ls`
You will get the output of ls not the text "ls"!

this is because `xxx` first execute xxx and then execute the output of xxx!

No don't execute but try to imagine what this will do:
`echo rm -rf \*`

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Grabbing tokens
by cbro (Pilgrim) on May 14, 2003 at 13:34 UTC
    I do know what the backticks mean...that is not the problem. I found out where the 'problem' is. Now...this is with the exact programs that I just posted on my last node. The reason we had a discrepency, IMO, is the versions of Perl we are using. You are right...the program does not work...at least not with perl, v5.6.1. I was working with perl, v5.00503, and it *DOES* work. I promise, I've ran it at least twenty times by now trying to replicate what you're getting. I ran it under 5.6.1 and there you go...I bow out, it's not working. BUT...If you have a 5.00503 install please try it so that I may have some redemption ;o).
      Sorry for you...
      $ ./p1 glob failed (child exited with status 1) at ./p1 line 3. :From Perl Not BASH Script $
        Do you have a "./" in front of the program name...cuz that's the only way I can get the 'glob failed' error you are getting. That's why I mentioned to use the exact program that I posted in my latter post not the first time I posted code. First, here is confirmation between the different runs.
        [cbro@chromium:~] $ /usr/local/bin/perl5.00503 testers.pl Success [cbro@chromium:~] $ /usr/local/bin/perl6 testers.pl `./testers.sh`
        Again, I only get the 'glob' failed if I do:
        $prg = "testers.sh"; $ret_val = <`$prg`> print "\n\n$ret_val\n\n";
        This is fixed immediately when I do:
        $prg = "./testers.sh";

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://258062]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (6)
As of 2024-03-28 09:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found