Sponsored Content
Full Discussion: copying content of a file
Top Forums UNIX for Dummies Questions & Answers copying content of a file Post 65471 by vgersh99 on Saturday 5th of March 2005 10:58:34 AM
Old 03-05-2005
firstly, pls read rules prior to posting - pay attention to #6 and #10. Pls don'tpost your email address in the future.

Although it does sound like a homework assignment - I'll give you something to start with:
Code:
 sed -e 's/^\([^:][^:]*\)/\1;SUF/' myFile

 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Copying selected content from file

I want to capture contents of a file between 2 strings into another file for eg all lines in between the keywords "start log" and "end log" should be copied into another file (1 Reply)
Discussion started by: misenkiser
1 Replies

2. UNIX for Dummies Questions & Answers

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive . what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me with the command and the... (0 Replies)
Discussion started by: skamal4u
0 Replies

3. Solaris

Copying the content of a filesystem to different Harddrive

my server runs solaris 10 , one of the partition in my primary harddrive is 99% full , i want to move the contents of it to the second harddrive which has higher capacity. what is the best way to move the contents to 2nd drive ? which command should i use cpio/dd/tar/ufsdump .... please guide me... (1 Reply)
Discussion started by: skamal4u
1 Replies

4. UNIX for Dummies Questions & Answers

Help with searching for a file in a directory and copying the contents of that file in a new file

Hi guys, I am a newbie here :wall: I need a script that can search for a file in a directory and copy the contents of that file in a new file. Please help me. :confused: Thanks in advance~ (6 Replies)
Discussion started by: zel2zel
6 Replies

5. Shell Programming and Scripting

To tar the content while copying files

Any idea on how we can tar the content while copying the files from one location to another location using the bash script. (2 Replies)
Discussion started by: gsiva
2 Replies

6. Shell Programming and Scripting

Copying lines from multiple logfiles, based on content of the line

d df d d (1 Reply)
Discussion started by: larsk
1 Replies

7. Shell Programming and Scripting

Shell :copying the content from one file to another

I have a log containing the below lines. file1.log ----------- module: module1 module10 module2 module002 module9 moduleRT100.2.1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ... (1 Reply)
Discussion started by: giridhar276
1 Replies

8. Shell Programming and Scripting

Sed: replace content from file with the content from file

Hi, I am having trouble while using 'sed' with reading files. Please help. I have 3 files. File A, file B and file C. I want to find content of file B in file A and replace it by content in file C. Thanks a lot!! Here is a sample of my question. e.g. (file A: a.txt; file B: b.txt; file... (3 Replies)
Discussion started by: dirkaulo
3 Replies

9. Shell Programming and Scripting

How to remove exisiting file content from a file and have to append new file content?

hi all, i had the below script x=`cat input.txt |wc -1` awk 'NR>1 && NR<'$x' ' input.txt > output.txt by using above script i am able to remove the head and tail part from the input file and able to append the output to the output.txt but if i run it for second time the output is... (2 Replies)
Discussion started by: hemanthsaikumar
2 Replies
Ns_ConnRead(3aolserver) 				   AOLserver Library Procedures 				   Ns_ConnRead(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
Ns_ConnGets, Ns_ConnRead, Ns_ConnFlushHeaders, Ns_ConnReadHeaders, Ns_ConnReadLine - Routines to copy connection content SYNOPSIS
#include "ns.h" char * Ns_ConnGets(buf, bufsize, conn) int Ns_ConnFlushContent(conn) int Ns_ConnRead(conn, vbuf, toread) int Ns_ConnReadHeaders(conn, set, nreadPtr) int Ns_ConnReadLine(conn, dsPtr, nreadPtr) ARGUMENTS
char *buf (in) Pointer to string buffer of length bufsize. int bufsize (in) Length of buffer pointer to by buf. Ns_Conn conn (in) Pointer to open connection. Ns_DString dsPtr (out) Pointer to initialized dstring to receive copied line. int *nreadPtr(out) Pointer to integer to receive number of bytes copied. Ns_Set set (in/out) Pointer to initialized Ns_Set to copy headers. int toread (in) Number of bytes to copy to location starting at vbuf void *vbuf (in) Pointer to memory location to copy content. _________________________________________________________________ DESCRIPTION
These routines support copying content from the connection. They all operate by copying from the content buffer returned by a call to Ns_ConnContent, maintaining a private, shared offset into the content. This means that these routines are not actually reading directly from the network and thus will not block waiting for input. See the man page on Ns_ConnContent for details on how the content is pre-read by the server and how resources are managed for small and large content requests. char *Ns_ConnGets(buf, bufsize, conn) Copies the next available line of text from the content to the given buf string, up to the given bufsize less space for a trailing null (). The result is a pointer to buf or NULL if an underlying call to Ns_ConnRead fails. int Ns_ConnFlushContent(conn) Performs a logical flush of the underlying content available to these routines. It simply moves the private offset to the end of the content. The result is NS_OK unless an underlying call to Ns_ConnContent failed in which case NS_ERROR is returned. int Ns_ConnRead(conn, vbuf, toread) Copies up to toread bytes from the content to the memory location pointed to by vbuf. The result is the number of bytes copied which will match toread unless less bytes are available in the input or -1 if an underlying call to Ns_ConnContent failed. int Ns_ConnReadHeaders(conn, set, nreadPtr) Copies lines up to the first blank line or end of content up to the maximum header read size specified with the communication driver "maxheader" parameter (default: 32k). Each line is parsed into "key: value" pairs into the given Ns_Set pointed to be the set argu- ment using the Ns_ParseHeader routine with the Ns_HeaderCaseDisposition specified by the "headercase" server option (default: Pre- serve). The result is NS_OK if all lines were consumed or NS_ERROR on overflow beyond the max header limit or if there was an error with the underlying call to Ns_ConnRead (including an error of a single line beyond the max line limit as described below). The integer pointed to by the nreadPtr argument, if given, is updated with the total number of bytes consumed. This routine can be use- ful when parsing multipart/form-data content to collect headers for each part. int Ns_ConnReadLine(conn, dsPtr, nreadPtr) Copies the next available line to the given dsPtr dstring. The integer pointed to by nreadPtr, if present, is updated with the num- ber of bytes copied. The line will not include the trailing or if present. The function will return NS_OK unless an under- lying call to Ns_ConnContent failed or the line exceeds the maximum line read size specified by the communication driver "maxline" parameter (default: 4k). This routine differs from Ns_ConnGets in that it copies the result to a dstring instead of a character buffer, requires a full or end-of-content terminated line, and enforces the maxline limit. SEE ALSO
Ns_ConnContent(3), Ns_ParseHeader(3) KEYWORDS
connection, read, content AOLserver 4.0 Ns_ConnRead(3aolserver)
All times are GMT -4. The time now is 06:54 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy