Sponsored Content
Full Discussion: Please resolve it
Top Forums UNIX for Dummies Questions & Answers Please resolve it Post 302263536 by veerumahanthi41 on Monday 1st of December 2008 10:13:20 PM
Old 12-01-2008
Please resolve it

Code:
#!/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 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)doecho $iecho The content in Z before commandZ="$(wget --dns-timeout=5.0 -O - http://napdweb${i}.eao.abn-iad.ea.co.../test/test.jsp)"echo $Zecho 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 appleecho The value in A before commandA="--03:52:29--  http://napdweb37.eao.abn-iad.ea.com:.../test/test.jspResolving napdweb37.eao.abn-iad.ea.com... failed: Connection timed out."echo $Aecho 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.jspResolving napdweb37.eao.abn-iad.ea.com... 10.120.244.76Connecting to napdweb37.eao.abn-iad.ea.com|10.120.244.76|:8000... connected.HTTP request sent, awaiting response... 200 OKLength: 67 [text/html]Saving to: `STDOUT'100%[====================================================================================================================>] 67          --.-K/s   in 0s03:29:12 (10.6 MB/s) - `-' saved [67/67]<html> <head> </head> <body> Test JSP page. </body> </html>The content in Z after command<hThe 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.

 

9 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. Shell Programming and Scripting

please resolve the below problem

#!/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.com:8000/webcore/test/test.jsp` echo $Z A="Connection timed out." echo The content in A echo $A expr "$A" : '..\(...\)' echo $A done ... (1 Reply)
Discussion started by: veerumahanthi41
1 Replies

5. 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

6. 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

7. Shell Programming and Scripting

Resolve Environment Variable

I am tyring to resolve an environment variable that is part of a string I selected from our database. Simply put, I want cd to this folder before checking if a file exists. The variable $in_loc has the value '$PS_HOME/int/VSP' where $PS_HOME is the environment variable. I am using cd... (6 Replies)
Discussion started by: consult_jb
6 Replies

8. Shell Programming and Scripting

Cannot resolve $var in awk

My script ---------- for i in `cat n`;do export k=`echo "CSN: "$i` //combining CSN: and value from n echo "$k" awk ''{print "CSN: "$0;}'{_=29}_&&_--' file1|tail -1 >> file2 done In the above script i cannot able to resolve $k in awk command file n contains ------------ 0000 1111... (0 Replies)
Discussion started by: Mohana29_1988
0 Replies

9. 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
wibble-test-genrunner(1)				      General Commands Manual					  wibble-test-genrunner(1)

NAME
wibble-test-genrunner - Code generator for wibble testsuites. SYNOPSIS
wibble-test-genrunner header <file> wibble-test-genrunner main <files> DESCRIPTION
The program generates .cpp files that are then compiled and linked into a test program for running tests from .test.h files. Examples of such .test.h files may be found among wibble headers, eg. /usr/include/wibble/regexp.test.h. In the first form, the program processes a single header file (usually of the form foo.test.h) and produces a corresponding .cpp file to be compiled. In the second form, it takes as <files> all the .test.h headers and produces a single main.cpp which contains the main() function of the test program, which then runs all the tests in all the .test.h files. The generated source code is always written to standard output and it is left up to the user to redirect it to a meaningful location. The program currently has no options other than the two forms above. The program is intended to be run as part of build process of programs or libraries using the wibble testing framework. For convenient use from CMake, there is a test.cmake script under /usr/share/wibble, that takes care of producing all the .cpp files (both per-header and the main one), compiling them and linking them into a single binary which executes the testsuite. AUTHOR
Petr Rockai <me@mornfall.net> wibble-test-genrunner(1)
All times are GMT -4. The time now is 03:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy