Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Header and trailer Check in UNIX Post 303042636 by Neo on Wednesday 1st of January 2020 11:09:16 PM
Old 01-02-2020
Quote:
Originally Posted by blackrageous
This is just a simple example to illustrate what I mean by posting something you've tried.
Correct.

We encourage all users at unix.com to post the code and scripts they have tried "on their own" and any error messages they got when they tried and failed.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Append Header and Trailer

Hi everyone, I am new to Unix programming. My inquries is:- a) How to add a Header and Trailer in the set of data b) Include a number count of the data in the trailer The set of data only contained the information of 'Customer's Name' and 'Account Number'. I would like to add the Header... (2 Replies)
Discussion started by: balzzz
2 Replies

2. Shell Programming and Scripting

Removing Header & Trailer from a file

Hi All, I am karthik. I am new to this forum. I have one requirement. I have a file with header and footer. Header may be like HDR0001 or FILE20090110 (Assume it is unknown so far, but i am sure there is a header in the file) likewise file has the trailer too. I just... (7 Replies)
Discussion started by: karthi_gana
7 Replies

3. Shell Programming and Scripting

Header as is.. trailer count

i have .DAT file FILE1.DAT 1200910270040625 2123456789 J123456 ABC 2123456789 K123456 ABC 2222222222 L123456 DEF 2333333333 M12345 GHI 30000004 My outfile FILE2.TXT should have like this, I need the header value as ie (1200910270040625 ) body rows remove the duplicate rows and the... (2 Replies)
Discussion started by: kshuser
2 Replies

4. Shell Programming and Scripting

Adding Header and Trailer records to a appended file

How can we a shell script and pass date parameters .I have 3 files comming from Datastage with |" delimited I need append 3 files as above: File1: P0000|"47416954|"AU|"000|"INS|"0000|"|"20060601|"99991231|"|"|"|"|"01 File 2:... (2 Replies)
Discussion started by: e1994264
2 Replies

5. UNIX for Dummies Questions & Answers

Adding header and trailer into a file

Hi, I want to add the below Header to all the files in sequence File1,File2,File3...etc "ABC,<number of chracter in the file>" e,g - If File1 is as below pqrstuvdt abcdefgh then I want to add the above header into it ,So that File1 becomes as below ABC,17 pqrstuvdt abcdefgh ... (9 Replies)
Discussion started by: spari2
9 Replies

6. UNIX for Dummies Questions & Answers

oneliner for adding header and trailer

for example, i have a file with below content: 123413 866688 816866 818818 i want the output as: This is header 123413 866688 816866 818818 This is trailer i am able to achieve it using a bash script. (2 Replies)
Discussion started by: pandeesh
2 Replies

7. Shell Programming and Scripting

Script to validate file header and trailer

Hi, I need a script that validates a file header/detail/trailer. File layout is: Header - Rec_Type|File_name|File_Date Detail - Rec_Type|field1|field2|field3... Trailder - Rec_Type|File_name|File_Date|Record_count Sample Data: HDR|customer_data.dat|20120709... (7 Replies)
Discussion started by: ash_sh
7 Replies

8. Shell Programming and Scripting

Verify the header and trailer in file

please see my requirement, I hope I am clear. (9 Replies)
Discussion started by: mirwasim
9 Replies

9. UNIX for Advanced & Expert Users

Removing Header and Trailer record of a EBCDIC file

I have a EBCDIC multi layout file which has a header record which is 21 bytes, The Detail records are 2427 bytes long and the trailer record is 9 bytes long. Is there a command to remove the header as well as trailer record and read only the detail records while at the same time not altering... (1 Reply)
Discussion started by: abhilashnair
1 Replies

10. Shell Programming and Scripting

Sort without Header and Trailer

Hi , My UNIX system is SUN Solaris. I am trying to do a simple thing as described below. I have a PIPE delimited file that has header and trailer. So the file is something like below: Test1.txt looks like something below: field_data1|field_data2|and some more data --Header ... (5 Replies)
Discussion started by: Saanvi1
5 Replies
INEWS(1)						    InterNetNews Documentation							  INEWS(1)

NAME
inews - Post a Usenet article to the local news server SYNOPSIS
inews [-ADhNORSVW] [-acdeFfnortwx value] [-p port] [file] DESCRIPTION
inews reads a Usenet news article, perhaps with headers, from file or standard input if no file is given. It adds some headers and performs some consistency checks. If the article does not meet those checks, the article is rejected. If it passes the checks, inews sends the article to the local news server as specified in inn.conf. By default, if a file named .signature exists in the home directory of the posting user, it is appended to the post, preceded by a line that contains only "-- ". Signatures are not allowed to be more than four lines long. Cancel messages can only be posted with inews if the sender of the cancel message matches the sender of the original message being cancelled. The same check is also applied to Supersedes. Sender in this case means the contents of the Sender header if present, otherwise the From header. Control messages other than cancel messages are only allowed if inews is being run by the news user or by a user in the news group and if the control message is recognized. If the article contains a Distribution header with a distribution that matches one of the bad distribution patterns in inn/options.h (anything containing a period by default), the message will be rejected. The message will also be rejected if checkincludedtext is true in inn.conf, it contains more quoted text than original text, and it is over 40 lines long. If not provided, the Path header of an article is constructed as follows: The basic Path header will be "not-for-mail". If pathhost is specified in inn.conf, it will be added to the beginning Path. Otherwise, if server is specified, the full domain of the local host will be added to the beginning of the Path. Then, if -x was given, its value will be added to the beginning of the Path. If posting fails, a copy of the failed post will be saved in a file named dead.article in the home directory of the user running inews. inews exits with a non-zero status if posting failed or with a zero status if posting was successful. OPTIONS
Most of the options to inews take a single value and set the corresponding header in the message that is posted. If the value is more than one word or contains any shell metacharacters, it must be quoted to protect it from the shell. Here are all the options that set header fields and the corresponding header: -a Approved -c Control -d Distribution -e Expires -F References -f From -n Newsgroups -o Organization -r Reply-To -t Subject -w Followup-To -x Path prefix The -x argument will be added to the beginning of the normal Path header; it will not replace it. -A, -V, -W Accepted for compatibility with C News. These options have no affect. -D, -N Perform the consistency checks and add headers where appropriate, but then print the article to standard output rather than sending it to the server. -N is accepted as as synonym for compatibility with C News. -h Normally, this flag should always be given. It indicates that the article consists of headers, a blank line, and then the message body. If it is omitted, the input is taken to be just the body of the message, and any desired headers have to be specified with command-line options as described above. -O By default, an Organization header will be added if none is present in the article. To prevent adding the default (from organization in inn.conf), use this flag. -p port Connect to the specified port on the server rather than to the default (port 119). -R Reject all control messages. -S Do not attempt to append ~/.signature to the message, even if it exists. NOTES
If the NNTP server requests authentication, inews will try to read passwd.nntp to get the username and password to use and will therefore need read access to that file. This is typically done by making that file group-readable and adding all users who should be able to use inews to post to that server to the appropriate group. inews used to do even more than it does now, and all of the remaining checks that are not dependent on the user running inews should probably be removed in favor of letting the news server handle them. Since INN's inews uses inn.conf and some other corners of an INN installation, it's not very appropriate as a general stand-alone inews program for general use on a system that's not running a news server. Other, more suitable versions of inews are available as part of various Unix news clients or by themselves. HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. Rewritten in POD by Russ Allbery <rra@stanford.edu>. $Id: inews.pod 8941 2010-01-28 20:45:16Z iulius $ SEE ALSO
inn.conf(5), passwd.nntp(5), rnews(1). INN 2.5.2 2010-02-08 INEWS(1)
All times are GMT -4. The time now is 03:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy