Sponsored Content
Top Forums Shell Programming and Scripting Adding a file at a particular place in another file Post 302269727 by Nicol on Thursday 18th of December 2008 11:17:29 AM
Old 12-18-2008
Thank you for your help !

Christian
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

adding lines at special place in crontab

Hi , i export the crontab in a file (i've no root right) and i would add lines from a file at a special place and rewrite the output in an another file. the special place is as this : 45 04 * * * /home/toto.sh > /dev/null 2>&1 # so i would search for toto.sh and insert the lines , the... (5 Replies)
Discussion started by: Nicol
5 Replies

2. Shell Programming and Scripting

insert file 1 at a specific place of file 2

Hello, I need to search in file2 for class A : public B { and insert right after that the content of file1. I am a bit lost as to which tools (which bash functions, awk...). I should use. Thanks for some directions here. Regards (1 Reply)
Discussion started by: JCR
1 Replies

3. Shell Programming and Scripting

Jump to a specific place in a file?

If I cat a file And want to go to the first instance of a particular value - what command would I use? And then from that point where I jumped to search for another value - but only search from that point forward not before the file? Thanks~ (2 Replies)
Discussion started by: llsmr777
2 Replies

4. Shell Programming and Scripting

editing file in place

Is in Unix a tool that could do this: paste -d":" 'file1' 'file2' | special_save "file1" # so that file1 would be treated in a way that would prevent problems with race condition I know it normally doesn't work but is there any intelligent way how to avoid using temporary file? I know methods... (6 Replies)
Discussion started by: MartyIX
6 Replies

5. Shell Programming and Scripting

How to insert a string in a file at specified place?

Hi all, I want to insert a string in a specified place of a very large file. I am giving an example of the task: I love football. Above is a sentence in a file and I want to insert a string "the" between love and football. It is not sure that where this particular line exists. It has to... (4 Replies)
Discussion started by: naw_deepak
4 Replies

6. Shell Programming and Scripting

Adding new lines to a file + adding suffix to a pattern

I need some help with adding lines to file and substitute a pattern. Ok I have a file: #cat names.txt name: John Doe stationed: 1 name: Michael Sweets stationed: 41 . . . And would like to change it to: name: John Doe employed permanently stationed: 1-office (7 Replies)
Discussion started by: hemo21
7 Replies

7. Shell Programming and Scripting

Read from file specific place in file using inode

Hello, I am using tcsh on AIX. I would like to write a script that does the following: 1. given an inode, how do I find exactly the name of the file? I know I could do this using ls -i | grep <inode> but it returns: <inode> <filename>. I need some string manipulation or something to... (1 Reply)
Discussion started by: lastZenMaster
1 Replies

8. Shell Programming and Scripting

Check file availability and place flag file

I have to check a directory on Linux (via shell Script which I am trying to build) for about 20 different source files with file patterns and if the files are made available in the directory, I should place flag files for which my other ETL jobs are waiting on to kick off. If the source files are... (6 Replies)
Discussion started by: dhruuv369
6 Replies

9. Shell Programming and Scripting

Search for a file in all directories and place the file in that directory

Hi All, Daily I am getting the updated file. I have to search for this file in all directories and sub directories. If the file existed in a particular directory then move this updated file to that particular directory. If the file is not existed in any of the directories then place this... (4 Replies)
Discussion started by: ROCK_PLSQL
4 Replies

10. UNIX for Beginners Questions & Answers

Adding to an array in an external file, and adding elements to it.

I have an array in an external file, "array.txt", which contains: char *testarray={"Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"};I want to be able to add an element to this array, and have that element display, whenever I call it, without having to recompile... (29 Replies)
Discussion started by: ignatius
29 Replies
Parser(3pm)						User Contributed Perl Documentation					       Parser(3pm)

NAME
HTTP::Parser - parse HTTP/1.1 request into HTTP::Request/Response object SYNOPSIS
my $parser = HTTP::Parser->new(); ... my $status = $parser->add($text); if(0 == $status) { print "request: ".$parser->request()->as_string(); # HTTP::Request } elsif(-3 == $status) { print "no content length header! "; } elsif(-2 == $status) { print "need a line of data "; } elsif(-1 == $status) { print "need more data "; } else { # $status > 0 print "need $status byte(s) "; } DESCRIPTION
This is an HTTP request parser. It takes chunks of text as received and returns a 'hint' as to what is required, or returns the HTTP::Request when a complete request has been read. HTTP/1.1 chunking is supported. It dies if it finds an error. new ( named params... ) Create a new HTTP::Parser object. Takes named parameters, e.g.: my $parser = HTTP::Parser->new(request => 1); request Allows or denies parsing an HTTP request and returning an "HTTP::Request" object. response Allows or denies parsing an HTTP response and returning an "HTTP::Response" object. If you pass neither "request" nor "response", only requests are parsed (for backwards compatibility); if you pass either, the other defaults to false (disallowing both requests and responses is a fatal error). add ( string ) Parse request. Returns: 0 if finished (call "object" to get an HTTP::Request or Response object) -1 if not finished but not sure how many bytes remain -2 if waiting for a line (like 0 with a hint) -3 if there was no content-length header, so we can't tell whether we are waiting for more data or not. If you are reading from a TCP stream, you can keep adding data until the connection closes gracefully (the HTTP RFC allows this). If you are reading from a file, you should keep adding until you have all the data. Once you have added all data, you may call "object". if you are not sure whether you have all the data, the HTTP::Response object might be incomplete. count if waiting for that many bytes Dies on error. This method of parsing makes it easier to parse a request from an event-based system, on the other hand, it's quite alright to pass in the whole request. Ideally, the first chunk passed in is the header (up to the double newline), then whatever byte counts are requested. When a request object is returned, the X-HTTP-Version header has the HTTP version, the uri() method will always return a URI object, not a string. Note that a nonzero return is just a hint, and any amount of data can be passed in to a subsequent add() call. data Returns current data not parsed. Mainly useful after a request has been parsed. The data is not removed from the object's buffer, and will be seen before the data next passed to add(). extra Returns the count of extra bytes (length of data()) after a request. object Returns the object request. Only useful after the parse has completed. AUTHOR
David Robins <dbrobins@davidrobins.net> Fixes for 0.05 by David Cannings <david@edeca.net> SEE ALSO
HTTP::Request, HTTP::Response. perl v5.10.1 2011-03-06 Parser(3pm)
All times are GMT -4. The time now is 07:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy