You had the wrong quotes.
and the shell will substitute the $arg.
--- Post updated at 11:14 ---
But if you have multiple Listen and want to insert test after the first one only, then it is better to get a line number:
This solution worked for me. However, I forgot about adding a new line (empty line) after the "Listen" string.
So the solution above works, but it includes the lines from add.txt immediately (the following line) after the Listen string.
I tried this :
It creates the empty line, but also has \n in that new line.
How do I create only the empty line, without the \n?
How can I insert, say lines 500 - 700 from another file into the current file on the current line (cursor) that I am editing while in vi (AIX).
I know how to insert the entire file but how do you do it when you only need certain lines from a huge file?
I've referenced my Unix Unleash book but... (2 Replies)
Hi folks,
i need to insert the same set of lines between each line
input lines
111111
aaaaaa
333333
output should be
111111
1
2
3
aaaaaa
1
2
3
333333
1 (2 Replies)
Hi,
I want to insert some lines in between the contents of a file but the file format should not be changed.
#!/usr/bin/sh -
# Link appropriate OS specific versions of vxicap and vxchk4badblks
vxlvmlink()
{
vxipath=/usr/lib/vxvm/bin
relmajor=`uname -v`
... (1 Reply)
Hello All,
I am new to this forum. I am currently facing a problem in manipulating files.
I have two files called old-matter and new-matter
# cat old-matter
abc: this, is a, sample, entry
byi: white board, is white in color
rtz: black, board is black
qty: i tried, a lot
asd: no... (1 Reply)
Hi,
I have one file, say file 1, that has data like below where 19900107 is the date,
19900107 12 144 129 0.7380047
19900108 12 168 129 0.3149017
19900109 12 192 129 3.2766666E-02
... (3 Replies)
Hi,
I copied the contents of a binary file into a .text file using hd (hexdump) command. The data in binary file is such that I get in many places like following
00000250 00 00 00 00 3f 2d 91 68 3f 69 fb e7 00 00 00 00 |....?-.h?i......|
00000260 00 00 00 00 00 00 00 00 00 00 00 00 00... (2 Replies)
Hello friends! I am working a Psychology/Neuro* project where I am sorting inline citations by category. The final step of the process has me a little stuck. I need to take citations from a text list and sort them in another text file.
Here is a file X example... (1 Reply)
Data file example
I look for primary and * to isolate the interesting slot number.
slot=`sed '/^primary$/,/\*/!d' filename | tail -1 | sed s'/*//' | awk '{print $1" "$2}'`
Now I want to get the Touch line for only the associate slot number, in this case, because the asterisk... (2 Replies)
Hello all,
I have a large csv file where there are four types of rows I need to merge into one row per person, where there is a column for each possible code / type of row, even if that code/row isn't there for that person.
In the csv, a person may be listed from one to four times... (9 Replies)
Hi, I need to print lines which are matching with start pattern "SELECT" and END PATTERN ";" and only select the last "select" statement including the ";" .
I have attached sample input file and the desired input should be as:
INPUT FORMAT:
SELECT
ABCD,
DEFGH,
DFGHJ,
JKLMN,
AXCVB,... (5 Replies)
Discussion started by: nani2019
5 Replies
LEARN ABOUT DEBIAN
http::proxy::bodyfilter::lines
HTTP::Proxy::BodyFilter::lines(3pm) User Contributed Perl Documentation HTTP::Proxy::BodyFilter::lines(3pm)NAME
HTTP::Proxy::BodyFilter::lines - A filter that outputs only complete lines
SYNOPSIS
use HTTP::Proxy::BodyFilter::lines;
use MyFilter; # this filter only works on complete lines
my $filter = MyFilter->new();
# stack both filters so that they'll handle text/* responses
$proxy->push_filter(
mime => 'text/*',
response => HTTP::Proxy::BodyFilter::lines->new,
response => $filter
);
# I want my lines to end with '!'
# This is equivalent to $/ = '!' in a normal Perl program
my $lines = HTTP::Proxy::BodyFilter::lines->new('!');
DESCRIPTION
The HTTP::Proxy::BodyFilter::lines filter makes sure that the next filter in the filter chain will only receive complete lines. The
"chunks" of data received by the following filters with either end with "
" or will be the last piece of data for the current HTTP message
body.
You can change the idea the filter has of what is a line by passing to its constructor the string it should understand as line ending. "
"
is the default value.
my $filter = HTTP::Proxy::BodyFilter::lines->new( $sep );
This is similar to modifying $/ in a Perl program. In fact, this filter has a behaviour so similar to modifying $/ that it also knows about
"paragraph mode" and "record mode".
Note that the "slurp" mode is not supported. Please use HTTP::Proxy::BodyFilter::complete to enable the generic store and forward filter
mechanism.
METHODS
This filter defines the following methods, which are automatically called:
init()
Initialise the filter with the EOL information.
filter()
Keeps unfinished lines for later.
will_modify()
This method returns a false value, thus indicating to the system that it will not modify data passing through.
SEE ALSO
HTTP::Proxy, HTTP::Proxy::BodyFilter.
AUTHOR
Philippe "BooK" Bruhat, <book@cpan.org>.
COPYRIGHT
Copyright 2003-2006, Philippe Bruhat.
LICENSE
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.
perl v5.12.4 2011-07-03 HTTP::Proxy::BodyFilter::lines(3pm)