please resolve the below problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting please resolve the below problem
# 1  
Old 12-01-2008
please resolve the below problem

Code:
#!/bin/sh
# 'clear'
for i in $(seq -w 15 37)
do
echo $i
echo The content in Z
Z=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp`
echo $Z
A="Connection timed out."
echo The content in A
echo $A
expr "$A" : '..\(...\)'
echo $A
done


Hi,Please see the above program.
The above program works for me but my problem is that i need to store a value in string once i get the output from "wget".
Moreover i need to find a sub-string for the obtained string.
I tried by using -O- option also.Please see the below program

Code:
#!/bin/sh
# 'clear'
for i in $(seq -w 15 37)
do
echo $i
echo The content in Z before command
Z="$(wget --dns-timeout=5.0 -O - http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp)"
echo $Z
echo The content in Z after command
 expr "$Z" : '..\(..\)'
#$ wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp > apple
#$ cat apple
echo The value in A before command
A="--03:52:29--  http://napdweb37.eao.abn-iad.ea.com:.../test/test.jsp
Resolving napdweb37.eao.abn-iad.ea.com... failed: Connection timed out."
echo $A
echo The value in A after command
 expr "$A" : '..............................................................................................................................\(.....................\)'
done

I got the following output

Code:
The content in Z before command
--03:29:11--  http://napdweb37.eao.abn-iad.ea.com:.../test/test.jsp
Resolving napdweb37.eao.abn-iad.ea.com... 10.120.244.76
Connecting to napdweb37.eao.abn-iad.ea.com|10.120.244.76|:8000... connected.
HTTP request sent, awaiting response... 200 OK
Length: 67 [text/html]
Saving to: `STDOUT'
100%[====================================================================================================================>] 67          --.-K/s   in 0s
03:29:12 (10.6 MB/s) - `-' saved [67/67]
<html> <head> </head> <body> Test JSP page. </body> </html>
The content in Z after command
<h
The value in A before command
--03:52:29-- http://napdweb37.eao.abn-iad.ea.com:.../test/test.jsp Resolving napdweb37.eao.abn-iad.ea.com... failed: Connection timed out.
The value in A after command
 Connection timed out

I have to extract the total output into a string but i am not able to do that.Once i get that into a string i have to do substring operation on it.
can anyone help me in resolving it.

Last edited by DukeNuke2; 12-01-2008 at 08:10 AM.. Reason: added code tags for better reading
# 2  
Old 12-01-2008
You have asked this question already yesterday.

Take a look at the forum rules:

Code:
(4) Do not 'bump up' questions if they are not answered promptly. No duplicate or cross-posting and do not report a post or send a private message where your goal is to get an answer more quickly.

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

Could not resolve ip through DNS

Dear all , Very recently our DNS server ip got changed. I have entered the DNS ip in /etc/resolv.conf ...but I could not resolv it for my ip address. Verified that , the IP is added in the DNS also. It is still working with the old DNS ip. Please let me know what could be... (11 Replies)
Discussion started by: jegaraman
11 Replies

2. HP-UX

nslookup/ping resolve problem 11i v3

I am having a problem with a new server build that has got me completely baffled. This server has a private back end network so the way it is supposed to work is that the server thinks its ip address is 10.131.0.48 but the rest of the world knows it as 199.68.100.100 per DNS. It has to be this way... (2 Replies)
Discussion started by: keelba
2 Replies

3. Shell Programming and Scripting

Please help to resolve the below script

Dear Members, Please help me to resolve below script. The script is used to send the attachment in the mail with all the details. However in one of the incidents, the attachment in the mail was blank. Now the client is after me to get it resolved ASAP. So prompt response would be highly... (2 Replies)
Discussion started by: SKO_TC
2 Replies

4. UNIX for Dummies Questions & Answers

Resolve IP to Hostname?

Good day, I would like to resolve IP's to Hostnames using Putty. I'm using Mandriva Linux 2008.0. Is this possible? Perhaps with nmap? (13 Replies)
Discussion started by: McGuywer
13 Replies

5. Linux

resolve one IP on DNS server

Hi! I have a dns server (bind) with 2 zones forward and reverse and i need to resolve one ip completely different. I have add to /etc/hosts and i can ping but i can't do nslookup. I've tried to add the dns server responsible to resolve that ip on /etc/resolv.conf without success. So how can i... (2 Replies)
Discussion started by: BufferExploder
2 Replies

6. UNIX for Dummies Questions & Answers

Please resolve it

#!/bin/sh# 'clear'for i in $(seq -w 15 37)doecho $iecho The content in ZZ=`wget --dns-timeout=0.001 http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp`echo $ZA="Connection timed out."echo The content in Aecho $Aexpr "$A" : '..\(...\)'echo $Adone Hi,Please see the above program. The above... (9 Replies)
Discussion started by: veerumahanthi41
9 Replies

7. Solaris

I am too young not to be able to resolve myself...nslookup problem (no DNS available)

I don't have DNS, and would like to resolve EVERYTHING through local /etc/hosts file. My first sunbox has the following configuration: # hostname mybox.home.com My host file is as follows: # cat /etc/hosts # # Internet host table # 127.0.0.1 localhost 192.25.x.x ... (6 Replies)
Discussion started by: mr_manny
6 Replies

8. Shell Programming and Scripting

Resolve a Variable

Hi I have a variable which is a path ie: UBERROR=/cobwrk/mchr/prodsup/ub/wrk/../error is there anyway I can get the output of an echo to read: #echo $UBERROR /cobwrk/mchr/prodsup/ub/error instead of #echo $UBERROR /cobwrk/mchr/prodsup/ub/wrk/../error Many thanks! (2 Replies)
Discussion started by: serm
2 Replies

9. UNIX for Dummies Questions & Answers

how do u resolve this????

Please help me on how to resolve: 1-unresponsive terminals 2-unresponsive applications 3-how to interrupt processe p.s unix/linux OS (1 Reply)
Discussion started by: zizu
1 Replies

10. IP Networking

Cannot Resolve Host Name

I am running LexMark MarkNetPro-3 print servers on my AIX network. All of the sudden, none of my printers will print anymore. I am getting an error message on the console: Unable to resolve host name. This message comes up everytime a user submits a print job. Any Ideas? (1 Reply)
Discussion started by: Docboyeee
1 Replies
Login or Register to Ask a Question