<p dir="ltr">On 07/08/2014 5:14 AM, "Simioni, Rodney" <<a href="mailto:rsimion@transunion.com">rsimion@transunion.com</a>> wrote:</p>
<p dir="ltr">> The actual wget call is:<br>
>  wget --post-file=SentinelCompReport.xml --header="Content-Type: text/xml" --header="SOAPAction: \"<a href="http://tlo.com/ComprehensivePersonSearch\">http://tlo.com/ComprehensivePersonSearch\</a>"" -O - http://<some vip>/BobService.asmx</p>

<p dir="ltr">> On the previous email, I put '<a href="http://xxx.com">xxx.com</a>' instead of <a href="http://tlo.com">tlo.com</a> in the wget call because I didn't want to broadcast my domain name to the world</p>

<p dir="ltr">Sorry, I didn't mean to "out" you. ;-)</p>
<p dir="ltr">> but I don't mind anymore -- so every wget call with have "<a href="http://tlo.com/ComprehensivePersonSearch">http://tlo.com/ComprehensivePersonSearch</a>"<br>
> but on the last http url call it should have the vip of where I'm sending this xml to; for example "<a href="http://vip">http://vip</a> from bb-host file/BobServices.asmx"</p>
<p dir="ltr">Ah, I see.</p>
<p dir="ltr">> From your script, it said "wget ... --header="SOAPAction: \"http://$1/ComprehensivePersonSearch\" -O - http://$2/BobService.asmx" But I'm guessing since we don't need to change the url for "<a href="http://tlo.com/ComprehensivePersonSearch\">http://tlo.com/ComprehensivePersonSearch\</a>"<br>

> we don't need the $1, correct?</p>
<p dir="ltr">Correct.</p>
<p dir="ltr">> Also, your script indicated "$BBHOME/bin/bbhostgrep foo | while read IP HOSTNAME OTHER; do"</p>
<p dir="ltr">The labels "IP", "HOSTNAME" and "OTHER" are labels used by the "read" command.  What "read" will do is to read one line from stdin and split it on whitespace into 3 variables. (The output from the bbhostgrep command is piped as stdin to the while loop to appear, one line at a time, as input to "read".)  The 3 variables are dynamically created as per the names (ie $IP, $HOSTNAME and $OTHER). We use OTHER to catch the rest of each line.</p>

<p dir="ltr">To understand a bit better, try this:</p>
<p dir="ltr">echo "a b c d e" | while read X Y Z; do echo "[$X][$Y][$Z]"; done</p>
<p dir="ltr">Then this:</p>
<p dir="ltr">cat /etc/hosts | while read X Y Z; do echo "[$X][$Y][$Z]"; done</p>
<p dir="ltr">> but HOSTNAME is not what I have defined in bb-hosts, I'm using aliases; for example, 10.218.160.150 is mapped to alias called server1 so I can't use<br>
> the alias for HOSTNAME because this command won't work "$BB $BBDISP "status $HOSTNAME.$TESTNAME $COL `date` $MSG", am I correct to assume this?</p>
<p dir="ltr">The value of $HOSTNAME will get the second word in the bb-hosts file. I could have used X, Y, Z instead of IP, HOSTNAME, OTHER, but the code wouldn't have been as readable.</p>
<p dir="ltr">> So, if my assumptions are correct, how should I correct this script you wrote to reflect my environment.</p>
<p dir="ltr">I think you would just change the $1 to the domain in your URL. Something like</p>
<p dir="ltr">    wget --post-file=SentinelCompReport.xml --header="Content-Type: text/xml" --header="SOAPAction: \"<a href="http://tlo.com/ComprehensivePersonSearch\">http://tlo.com/ComprehensivePersonSearch\</a>"" -O - http://$2/BobService.asmx</p>

<p dir="ltr">J<br>
</p>