![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Need to run the script by argument passing | asirohi | Shell Programming and Scripting | 3 | 08-21-2009 11:15 AM |
| Passing non Awk Argument in Awk | saifurshaon | Shell Programming and Scripting | 1 | 03-19-2009 06:57 AM |
| passing Argument | Shahul | Shell Programming and Scripting | 4 | 11-13-2008 08:50 AM |
| Problem in argument passing | tsaravanan | Shell Programming and Scripting | 4 | 09-23-2008 08:53 AM |
| passing argument into awk | prkfriryce | Shell Programming and Scripting | 4 | 02-01-2007 04:44 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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: Code:
GET domain.tld | bash -- parameter GET domain.tld | bash parameter GET domain.tld parameter | bash GET domain.tld -- parameter | bash bash < GET domain.tld |
|
||||
|
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:
Code:
#!/usr/bin/bash
testFile=$1
if [[ -z "$testFile" ]]
then
echo "No parameter specified."
else
echo "Parameter specified, $testFile"
fi
Code:
-bash-3.2$ GET domain.tld/test | bash No parameter specified. The above code, being simple in construction, should have any text passed to it. |
![]() |
| Bookmarks |
| Tags |
| bash, parameter, pipe, shell |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|