I made some updates to the script and it works, may not very beautiful, but it does what I need to look at the first and second line after the string match.
Dear Collegue
Do anybody help me to convert this AWK script to Perl script
{
for (i = 2; i <= length ($0); i++) {
x = substr($0, i , 1)
if (c > 0) {
b = b x
if (x == "(") c++
... (2 Replies)
i have an output like this :
012008
25760883
022008
12273095
032007
10103
032008
10115642
042007
20952798
but i would like to have it like this
012008,25760883
022008,12273095
032007,10103
032008,10115642
042007,20952798 (4 Replies)
For the following perl script, can anyone help to convert it to awk statement in windows2003 server environment ?
Code:
foreach $k (sort {$a <=> $b} keys %psnum) (1 Reply)
Hi all!
How can a file be rid of three lines in sequence like the sample below:
...
</s>
<s>
<w></w>
</s>
<s>
...to get:
...
</s>
<s>
...
Note that the digits between square brackets may be more than one, comprising a comma, or a full-stop; and that the string between brackets... (1 Reply)
Hi all,
Not sure if this should be in the programming forum, but I believe it will get more response under the Shell Programming and Scripting FORUM.
Am trying to write a customized df script in Perl and need some help with regards to using arrays and file handlers.
At the moment am... (3 Replies)
Hi all;
I have a Perl script that uses this awk command wrapped in a "system" call; it works exactly as I want it; however I want to keep this a Perl script and have very few if any "system" command...so the question; can someone help me code this in Perl please ... i have tried an now I am... (1 Reply)
Input file (a list of input file name with *.txt extension):
campus.com_icmp_ping_alive.txt
data_local_cd_httpd.txt
data_local_cd.txt
new_local_cd_mysql.txt
new_local_cd_nagios_content.txt
Desired output file:
data local_cd_httpd
data local_cd
new local_cd_mysql
new ... (9 Replies)
Hi,
Just trying to get to grips with sed and awk for some reporting for work and I need some assistance:
I have a file that lists policy names on the first line and then on the second line whether the policy is active or not.
Policy Name: Policy1
Active: yes
Policy... (8 Replies)
hi friends,
i am able to parse cvs diff file using bit of cut and grep commands to produce following output in text file
'''cvs-diff.txt'''
Package-Name = dev-freetype.
Old-Version = 2.4.8
New-Version = 2.4.10
Patches-removed = freetype-2.4.8-cross-compile.patch... (2 Replies)
Discussion started by: alexzander18
2 Replies
LEARN ABOUT MOJAVE
curlopt_resolve
CURLOPT_RESOLVE(3) curl_easy_setopt options CURLOPT_RESOLVE(3)NAME
CURLOPT_RESOLVE - provide custom host name to IP address resolves
SYNOPSIS
#include <curl/curl.h>
CURLcode curl_easy_setopt(CURL *handle, CURLOPT_RESOLVE,
struct curl_slist *hosts);
DESCRIPTION
Pass a pointer to a linked list of strings with host name resolve information to use for requests with this handle. The linked list should
be a fully valid list of struct curl_slist structs properly filled in. Use curl_slist_append(3) to create the list and
curl_slist_free_all(3) to clean up an entire list.
Each single name resolve string should be written using the format HOST:PORT:ADDRESS where HOST is the name libcurl will try to resolve,
PORT is the port number of the service where libcurl wants to connect to the HOST and ADDRESS is the numerical IP address. If libcurl is
built to support IPv6, ADDRESS can of course be either IPv4 or IPv6 style addressing.
This option effectively pre-populates the DNS cache with entries for the host+port pair so redirects and everything that operations against
the HOST+PORT will instead use your provided ADDRESS. Addresses set with CURLOPT_RESOLVE(3) will not time-out from the DNS cache like ordi-
nary entries.
The provided ADDRESS set by this option will be used even if CURLOPT_IPRESOLVE(3) is set to make libcurl use another IP version.
Remove names from the DNS cache again, to stop providing these fake resolves, by including a string in the linked list that uses the format
"-HOST:PORT". The host name must be prefixed with a dash, and the host name and port number must exactly match what was already added pre-
viously.
DEFAULT
NULL
PROTOCOLS
All
EXAMPLE
CURL *curl;
struct curl_slist *host = NULL;
host = curl_slist_append(NULL, "example.com:80:127.0.0.1");
curl = curl_easy_init();
if(curl) {
curl_easy_setopt(curl, CURLOPT_RESOLVE, host);
curl_easy_setopt(curl, CURLOPT_URL, "http://example.com");
curl_easy_perform(curl);
/* always cleanup */
curl_easy_cleanup(curl);
}
curl_slist_free_all(host);
AVAILABILITY
Added in 7.21.3. Removal support added in 7.42.0.
RETURN VALUE
Returns CURLE_OK if the option is supported, and CURLE_UNKNOWN_OPTION if not.
SEE ALSO CURLOPT_IPRESOLVE(3), CURLOPT_DNS_CACHE_TIMEOUT(3), CURLOPT_CONNECT_TO(3),
libcurl 7.54.0 May 17, 2016 CURLOPT_RESOLVE(3)