Sponsored Content
Top Forums Shell Programming and Scripting Add new parameters into a line, and redirect the line to other file Post 302411327 by rafazz on Thursday 8th of April 2010 09:22:54 AM
Old 04-08-2010
if I wanna extract a certain line like the line with $name google. How can i do that?
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

how do you parse 1 line at a time of file1 ie. line(n) each line into new file

File 1 <html>ta da....unique file name I want to give file=>343...</html> <html>da ta 234 </html> <html>pa da 542 </html> and so on... File 2 343 234 542 and so on, each line in File 1 one also corresponds with each line in File 2 I have tried several grep, sed, while .. read, do,... (4 Replies)
Discussion started by: web_developer
4 Replies

2. Shell Programming and Scripting

Want to use sed to add some parameters at the end of the line

Hello All, I have a doubt in sed, i want to add some parameter at the end of the tag inside a xml tag. how to i do that. so i want to add Results="true" value="high" inside the xml tag. Orignal <execute description="reboot"> <execute description="Stop Servlet"> After adding the... (5 Replies)
Discussion started by: asirohi
5 Replies

3. Shell Programming and Scripting

howto add line as a first line into a non empty file

Hi Trying to do like this : echo "$variable1\n $(cat file.txt)" but it only adds one time. When I run this cmd again with different variable it only replaces line of variable1. How to add constantly line into first line in file ? (3 Replies)
Discussion started by: presul
3 Replies

4. Shell Programming and Scripting

[Solved] Problem in reading a file line by line till it reaches a white line

So, I want to read line-by-line a text file with unknown number of files.... So: a=1 b=1 while ; do b=`sed -n '$ap' test` a=`expr $a + 1` $here do something with b etc done the problem is that sed does not seem to recognise the $a, even when trying sed -n ' $a p' So, I cannot read... (3 Replies)
Discussion started by: hakermania
3 Replies

5. Shell Programming and Scripting

Add line break for each line in a file

I cannot seem to get this to work.. I have a file which has about 100 lines, and there is no end of line (line break \n) at the end of each line, and this is causing problem when i paste them into an application. the file looks like this this is a test that is a test balblblablblhblbha... (1 Reply)
Discussion started by: fedora
1 Replies

6. Shell Programming and Scripting

Replace and add line in file with line in another file based on matching string

Hi, I want to achieve something similar to what described in another post: The difference is I want to add the line if the pattern is not found. File 1: A123, valueA, valueB B234, valueA, valueB C345, valueA, valueB D456, valueA, valueB E567, valueA, valueB F678, valueA, valueB ... (11 Replies)
Discussion started by: jyu3
11 Replies

7. Shell Programming and Scripting

Need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line...

Hello, I need a program that read a file line by line and prints out lines 1, 2 & 3 after an empty line... An example of entries in the file would be: SRVXPAPI001 ERRO JUN24 07:28:34 1775 REASON= 0000, PROCID= #E506 #1065: TPCIPPR, INDEX= 003F ... (8 Replies)
Discussion started by: Ferocci
8 Replies

8. Shell Programming and Scripting

How to read file line by line and compare subset of 1st line with 2nd?

Hi all, I have a log file say Test.log that gets updated continuously and it has data in pipe separated format. A sample log file would look like: <date1>|<data1>|<url1>|<result1> <date2>|<data2>|<url2>|<result2> <date3>|<data3>|<url3>|<result3> <date4>|<data4>|<url4>|<result4> What I... (3 Replies)
Discussion started by: pat_pramod
3 Replies

9. UNIX for Beginners Questions & Answers

Get an output of lines in pattern 1st line then 10th line then 11th line then 20th line and so on.

Input file: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 (6 Replies)
Discussion started by: Sagar Singh
6 Replies
HEADERS_SENT(3) 							 1							   HEADERS_SENT(3)

headers_sent - Checks if or where headers have been sent

SYNOPSIS
bool headers_sent ([string &$file], [int &$line]) DESCRIPTION
Checks if or where headers have been sent. You can't add any more header lines using the header(3) function once the header block has already been sent. Using this function you can at least prevent getting HTTP header related error messages. Another option is to use Output Buffering. PARAMETERS
o $file - If the optional $file and $line parameters are set, headers_sent(3) will put the PHP source file name and line number where out- put started in the $file and $line variables. o $line - The line number where the output started. RETURN VALUES
headers_sent(3) will return FALSE if no HTTP headers have already been sent or TRUE otherwise. EXAMPLES
Example #1 Examples using headers_sent(3) <?php // If no headers are sent, send one if (!headers_sent()) { header('Location: http://www.example.com/'); exit; } // An example using the optional file and line parameters, as of PHP 4.3.0 // Note that $filename and $linenum are passed in for later use. // Do not assign them values beforehand. if (!headers_sent($filename, $linenum)) { header('Location: http://www.example.com/'); exit; // You would most likely trigger an error here. } else { echo "Headers already sent in $filename on line $linenum " . "Cannot redirect, for now please click this <a " . "href="http://www.example.com">link</a> instead "; exit; } ?> NOTES
Note Headers will only be accessible and output when a SAPI that supports them is in use. SEE ALSO
ob_start(3), trigger_error(3), headers_list(3), header(3) for a more detailed discussion of the matters involved. . PHP Documentation Group HEADERS_SENT(3)
All times are GMT -4. The time now is 08:18 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy