Using GET, passing argument to bash

Hi guys!

So, I use GET ( Simple user agent using LWP library. ) on a remote text file that is then passed to bash and executed. However, I need to pass that bash script a single argument, and so far nothing that I have tried has worked, although I have learned quite a bit about input/output redirection, pipes, and everything else! I have shown below SOME of the man attempts:

GET domain.tld | bash -- parameter
GET domain.tld | bash parameter
GET domain.tld parameter | bash
GET domain.tld -- parameter | bash
bash < GET domain.tld

Any help for this particular issue would be great!

Could you post an example of GET's output? What exactly you're trying to pass to bash?
If I understand correctly this one should do it:

GET domain.tld parameter | bash

Doesn't matter what code you use as long as it wants an arg/param, and doesnt matter what you parse to it, for instance:

#!/usr/bin/bash

testFile=$1

if [[ -z "$testFile" ]]
then
    echo "No parameter specified."
else
    echo "Parameter specified, $testFile"
fi

Now on another remote server:

-bash-3.2$ GET domain.tld/test | bash
No parameter specified.

If you try adding anything as bash's args (aside from its standard args) it will tell you that particular file is not found (such as: bash -- arghere).

The above code, being simple in construction, should have any text passed to it.

zsh-4.3.10[t]% cat s    
#!/usr/bin/bash

testFile=$1

if [[ -z "$testFile" ]]
then
    echo "No parameter specified."
else
    echo "Parameter specified, $testFile"
fi
zsh-4.3.10[t]% bash s x 
Parameter specified, x

In your case:

bash  <(GET ...) param1 [param2 ... n]

This perhaps?

bash <(GET domain.tld parameter) 

or

(GET domain.tld parameter)|bash

radoulov - Thank you very very much, that worked perfectly! Now I need to go study more bash!