Sponsored Content
Full Discussion: working with files
Top Forums Shell Programming and Scripting working with files Post 302127237 by matrixmadhan on Tuesday 17th of July 2007 01:28:50 AM
Old 07-17-2007
Do not bump up posts if they are not promptly answered.

wc -l for the file shows 632
and the trailer record inside the file shows as 630.
Application might have written only the count of detailed records which actually evaluates to 632 - 2 ( header + trailer ) = 630

Could you please check that ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash script working for small size files but not for big size files.

Hi, I have one file stat. Stat file contents are as follows: for example. H50768020040913,00260100,507680,13,0000000643,0000000643,00000,0000 H50769520040808,00260100,507695,13,0000000000,0000000000,00000,0000 H50770620040611,00260100,507706,13,0000000000,0000000000,00000,0000 Now i... (1 Reply)
Discussion started by: davidpreml
1 Replies

2. UNIX for Dummies Questions & Answers

RedirectMatch not working for files

Hi I am trying to redirect all webpages within a directory on my site to another website. I can only get this to work for directories only, not actual files. The following scenarios work: http://www.mysite.com/folder1/folder3 redirects to http://www.newsite.com/redirectpage.jsp ... (0 Replies)
Discussion started by: geoscience
0 Replies

3. AIX

exclude files not working

HI, I have upgraded nim master and client to TL8,SP6. Now when the mksysb backup ran from master,it is not excluding directories specified in /etc/exclude.rootvg in the client.Instead,mksysb is getting created for all the file systems in the rootvg. This problem only appeared after the TL... (3 Replies)
Discussion started by: to_bsr
3 Replies

4. Shell Programming and Scripting

Working with log files

I wrote a bash script to extract a few Items like the IP addresses that makes the most number of connection attempts, now I want to limit all of this within a time range , lets say the last X days/hours. Example of what I wrote : -G: Which IP address makes the most number of connection... (2 Replies)
Discussion started by: melisa.zand
2 Replies

5. Shell Programming and Scripting

Working on Files

Hi, One of the program creating a file with the following information. $cat a.txt 1, AAA, 234 $ and I wrote a script whenever any of the the file exists with data then it will send a email to me. If I start the job second time, then the as per the logic it is sending the same data, I... (3 Replies)
Discussion started by: Alex_Smith
3 Replies

6. Shell Programming and Scripting

Problem while working with multiple files

Dear friends, I am working with two files named g1.txt and g2.txt....g1.txt is my main file in which it contains following data #per_no permissionname permission command 1|HideCDrive, | : REG ADD "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" /v... (1 Reply)
Discussion started by: jalpasoni
1 Replies

7. Shell Programming and Scripting

[awk] working with two files

Hello guys, I have little to no experience working with two files in awk and hope you can help me with a problem that may be easy for you to solve... awk -v cut1="$var1" -v cut2="$var2" '{split($0, arr1); for(i=1;i<=NF;i++) if (arr1 < cut1) print arr1, NR, i}' file1 file2 The above code is... (4 Replies)
Discussion started by: origamisven
4 Replies

8. Shell Programming and Scripting

Working with files that are named with a timestamp

So I have a script that runs an ls on a given directory and looks for files with a timestamp that has the current hour in it and then does work with the files that it discovers DATE=`date +'%y%m%d%H'` HOSTIS=`hostname` #EMAIL NOTIFICATION ALS EMAIL=address@server.com # if ; then ... (5 Replies)
Discussion started by: os2mac
5 Replies

9. Shell Programming and Scripting

Output, working with files. What is wrong?

I cannot figure out what is wrong.... I have 3 files with IP addresses: file1 134.123.3.236 file2 134.123.3.235 file3 134.123.5.237 I type "prob1 Oops x2x3x4". Then my code creates file with name Oops and first line x2x3x4. Moreover, my code generate IP and it gives to file Oops as a second... (8 Replies)
Discussion started by: Manu1234567
8 Replies

10. Red Hat

Apache chown on its files not working

Hello, My apache user generate one file : # ls -lsa /tmp/reference_file.csv 76 -rwxrwxrwx 1 apache apache 69921 Aug 16 14:14 tmp/reference_file.csv the user and the group belong to apache, but when i am trying to change it : su -l apache -s /bin/bash -bash-3.00$ whoami apache... (7 Replies)
Discussion started by: cterra
7 Replies
CURLOPT_HEADERFUNCTION(3)				     curl_easy_setopt options					 CURLOPT_HEADERFUNCTION(3)

NAME
CURLOPT_HEADERFUNCTION - callback that receives header data SYNOPSIS
#include <curl/curl.h> size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata); CURLcode curl_easy_setopt(CURL *handle, CURLOPT_HEADERFUNCTION, header_callback); DESCRIPTION
Pass a pointer to your callback function, which should match the prototype shown above. This function gets called by libcurl as soon as it has received header data. The header callback will be called once for each header and only complete header lines are passed on to the callback. Parsing headers is very easy using this. The size of the data pointed to by buf- fer is size multiplied with nmemb. Do not assume that the header line is zero terminated! The pointer named userdata is the one you set with the CURLOPT_HEADERDATA(3) option. This callback function must return the number of bytes actually taken care of. If that amount dif- fers from the amount passed in to your function, it'll signal an error to the library. This will cause the transfer to get aborted and the libcurl function in progress will return CURLE_WRITE_ERROR. A complete HTTP header that is passed to this function can be up to CURL_MAX_HTTP_HEADER (100K) bytes. If this option is not set, or if it is set to NULL, but CURLOPT_HEADERDATA(3) is set to anything but NULL, the function used to accept response data will be used instead. That is, it will be the function specified with CURLOPT_WRITEFUNCTION(3), or if it is not specified or NULL - the default, stream-writing function. It's important to note that the callback will be invoked for the headers of all responses received after initiating a request and not just the final response. This includes all responses which occur during authentication negotiation. If you need to operate on only the headers from the final response, you will need to collect headers in the callback yourself and use HTTP status lines, for example, to delimit response boundaries. When a server sends a chunked encoded transfer, it may contain a trailer. That trailer is identical to a HTTP header and if such a trailer is received it is passed to the application using this callback as well. There are several ways to detect it being a trailer and not an ordinary header: 1) it comes after the response-body. 2) it comes after the final header line (CR LF) 3) a Trailer: header among the regu- lar response-headers mention what header(s) to expect in the trailer. For non-HTTP protocols like FTP, POP3, IMAP and SMTP this function will get called with the server responses to the commands that libcurl sends. DEFAULT
Nothing. PROTOCOLS
Used for all protocols with headers or meta-data concept: HTTP, FTP, POP3, IMAP, SMTP and more. EXAMPLE
static size_t header_callback(char *buffer, size_t size, size_t nitems, void *userdata) { /* received header is nitems * size long in 'buffer' NOT ZERO TERMINATED */ /* 'userdata' is set with CURLOPT_HEADERDATA */ return nitems * size; } CURL *curl = curl_easy_init(); if(curl) { curl_easy_setopt(curl, CURLOPT_URL, "http://example.com"); curl_easy_setopt(curl, CURLOPT_HEADERFUNCTION, header_callback); curl_easy_perform(curl); } AVAILABILITY
Always RETURN VALUE
Returns CURLE_OK SEE ALSO
CURLOPT_HEADERDATA(3), CURLOPT_WRITEFUNCTION(3), libcurl 7.54.0 February 03, 2016 CURLOPT_HEADERFUNCTION(3)
All times are GMT -4. The time now is 05:29 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy