Sponsored Content
Top Forums Shell Programming and Scripting Why does '$$' means an empty line in agrep -d '$$' Post 302289135 by qiulang on Wednesday 18th of February 2009 09:25:44 PM
Old 02-18-2009
By empty line I mean a new line without any characters

Thanks for the reply.

By empty line I mean a new line without any characters (just ~n).
It is not just TRE agrep, for all the agrep versions I find, all their help files come with an example like this,

agrep -d '$$' pattern foo will output all paragraphs (separated by an empty line) that contain pattern.


Either they just copy paste the example or we did miss something here and $$ does mean "empty line". I feel really confused now.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

empty line

new problem comes out.. unix script calls sql script and save the output into a file. but now there are many empty lines in the output file. first line is empty and follow by 13 rows of data and another empty line and data and so on.. how can I fix that? thanks (4 Replies)
Discussion started by: YoYo
4 Replies

2. Shell Programming and Scripting

agrep: pattern too long

agrep -d Seconds "29 06 0e 2b 06 01 04 01 9d 64 03 08 02 01 05 05" filename agrep: pattern too long Guys, I am trying to grep for some data in a flat ascii file and I get this error, can someone please help me out (3 Replies)
Discussion started by: knijjar
3 Replies

3. Shell Programming and Scripting

Please let me know what this line in cron means?

Hi All, I found this line in my crontab.. 0 6 * * * "some script name" my question is it means the script should run at 6 00 am. But on what those days are not mentioned. Then in that case when will the script will run? Thanks for ur help in advance, Magesh (3 Replies)
Discussion started by: mac4rfree
3 Replies

4. Shell Programming and Scripting

How to specify two delimiters in agrep for record definition ?

Hi all, How to specify two delimiters in agrep for record definition, one for the beginning of the record and the other for the end ? Most of examples I see so far only specify 1 delimiter, e.g. agrep -d '^From ' 'pizza' mbox. But that won't work for me. I need to 2 delimiters to indicate the... (2 Replies)
Discussion started by: qiulang
2 Replies

5. 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

6. Shell Programming and Scripting

Fill the empty line by adding line before blank line

FIle A "A" 2 aa 34 3 ac 5 cd "B" 3 hu 67 4 fg 5 gy output shud be A"" 2 aa 34 "A" 3 ac 34 "A" 5 cd 34 "B" 3 hu 67 "B" 4 fg 67 "B" 5 gy 67 (6 Replies)
Discussion started by: cdfd123
6 Replies

7. Shell Programming and Scripting

I need to know how to replace a line after a pattern match with an empty line using SED

Hi How Are you? I am doing fine! I need to go now? I will see you tomorrow! Basically I need to replace the entire line containing "doing" with a blank line: I need to the following output: Hi How Are you? I need to go now? I will see you tomorrow! Thanks in advance.... (1 Reply)
Discussion started by: sags007_99
1 Replies

8. Programming

[SOLVED] C++ print next line until line.empty

Hi, could you please help with the following: I have an input file like: one two three four five six I want to print the lines starting from 'three' to the empty line. Something like that: if ( line == "three" ) { while ( !line.empty() ) { cout <<... (0 Replies)
Discussion started by: apenkov
0 Replies

9. 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
PASTE(1)						    BSD General Commands Manual 						  PASTE(1)

NAME
paste -- merge corresponding or subsequent lines of files SYNOPSIS
paste [-s] [-d list] file ... DESCRIPTION
The paste utility concatenates the corresponding lines of the given input files, replacing all but the last file's newline characters with a single tab character, and writes the resulting lines to standard output. If end-of-file is reached on an input file while other input files still contain data, the file is treated as if it were an endless source of empty lines. The options are as follows: -d list Use one or more of the provided characters to replace the newline characters instead of the default tab. The characters in list are used circularly, i.e., when list is exhausted the first character from list is reused. This continues until a line from the last input file (in default operation) or the last line in each file (using the -s option) is displayed, at which time paste begins selecting characters from the beginning of list again. The following special characters can also be used in list: newline character tab character \ backslash character Empty string (not a null character). Any other character preceded by a backslash is equivalent to the character itself. -s Concatenate all of the lines of each separate input file in command line order. The newline character of every line except the last line in each input file is replaced with the tab character, unless otherwise specified by the -d option. If '-' is specified for one or more of the input files, the standard input is used; standard input is read one line at a time, circularly, for each instance of '-'. EXIT STATUS
The paste utility exits 0 on success, and >0 if an error occurs. EXAMPLES
List the files in the current directory in three columns: ls | paste - - - Combine pairs of lines from a file into single lines: paste -s -d ' ' myfile Number the lines in a file, similar to nl(1): sed = myfile | paste -s -d ' ' - - Create a colon-separated list of directories named bin, suitable for use in the PATH environment variable: find / -name bin -type d | paste -s -d : - SEE ALSO
cut(1), lam(1) STANDARDS
The paste utility is expected to be IEEE Std 1003.2 (``POSIX.2'') compatible. HISTORY
A paste command appeared in Version 32V AT&T UNIX. BSD
June 25, 2004 BSD
All times are GMT -4. The time now is 06:45 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy