I want to delete all matches in a text following this pattern:
Each match starts with linux-
Each match ends with a space
(Remove linux-* until immediate next space)
Are you aware that these stipulations will exclude a "linux-something" at the lines end from being removed because there will be no space afterwards? Maybe this is not what you want. Also notice that your clause 2 means that the space immediately following the word "linux-*" will be removed too.
If your goal is indeed to remove the last match too i'd suggest:
If you want to retain the blank following the word but would not want to add a space at the end of the string then this:
if I have "abxcdxefx" and want to remove the x's with sed, how can I do this?
Thanks.
WHOOPS:
Just remembered:
echo "abxcdxefx" | sed s/x//g
Thanks for reading, though. (0 Replies)
Hi,
I need to unload some data from Informix database into text file.
But what happen is when i open the text file, some record split into 2 line, become uncomplete.
I had checked is due to some unregconized space in particular fields, i used many way to detect this unregconized space, but... (3 Replies)
but keep if does not
I have a file: --> my.out
foo: bar
foo: moo
blarg
i am on vacation
foo: goose
foo: lucy
foo: moose
foo: stucky
groover@monkey.org
foo: bozo
grimace@gonzo.net
dear sir - blargo blargo
foo: goon
foo: sloppy
foo: saudi
gimme gimme gimme (3 Replies)
I have a customer file now and would like to separate the names into two cells in a spreadsheet. Here is my data as an example:
SHAWN R KEEGAN
shawn r scroggin
Shawn Regan
Shawn Reilly
The first two have the middle initial so I'd like to include them in the "first name" field and the last... (11 Replies)
Hi,
I have requirement that I need to split my input file into two files based on a search pattern "abc"
For eg. my input file has below content
abc
defgh
zyx
I need file 1 with
abc
and file2 with
defgh
zyx
I can use grep command to acheive this. But with grep I need... (8 Replies)
Hi all,
Can anyone help me on this. I have several WP sites that are affected by sql injections. But the contents are different as follows
western union india belgaum
western union india bolegaon
western union india barhaj
western union india budhana
western union india belda
western... (6 Replies)
I created a awk state to calculate the number of success however when the query runs it has a leading zero. Any ideas on how to remove the leading zero from the calculation?
Here is my query:
cat myfile.log | grep | awk '{print $2,$3,$7,$11,$15,$19,$23,$27,$31,$35($19/$15*100)}'
02:00:00... (1 Reply)
I have one requirement to delete all lines from a file if it matches below scenario. File contains three column. Employee Number, Employee Name and Employee ID
Scenario is: delete all line if Employee Number (1st column) contains below
1. Non-numeric Employee Number
2. Employee Number that... (3 Replies)
I am trying to remove lines in the target.txt file if $5 before the - in that file matches sorted_list. I have tried grep and awk. Thank you :).
grep
grep -v -F -f targets.bed sort_list
grep -vFf sort_list targets
awk
awk -F, '
> FILENAME == ARGV {to_remove=1; next}
> ! ($5 in... (2 Replies)
I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: -->
cat comp.pkglist
Package list: nss-util-devel-3.28.4-1.el6_9.x86_64
Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies
LEARN ABOUT DEBIAN
pminst
PMINST(1p) User Contributed Perl Documentation PMINST(1p)NAME
pminst - find modules whose names match this pattern
SYNOPSIS
pminst [-s] [-l] [pattern]
DESCRIPTION
Without argumnets, show the names of all installed modules. Given a pattern, show all module names that match it. The -l flag will show
the full pathname. The -s flag will separate the base directory from @INC from the module portion itself.
EXAMPLES
$ pminst
(lists all installed modules)
$ pminst Carp
CGI::Carp
Carp
$ pminst ^IO::
IO::Socket::INET
IO::Socket::UNIX
IO::Select
IO::Socket
IO::Poll
IO::Handle
IO::Pipe
IO::Seekable
IO::Dir
IO::File
$ pminst '(?i)io'
IO::Socket::INET
IO::Socket::UNIX
IO::Select
IO::Socket
IO::Poll
IO::Handle
IO::Pipe
IO::Seekable
IO::Dir
IO::File
IO
Pod::Functions
The -s flag provides output with the directory separated
by a space:
$ pminst -s | sort +1
(lists all modules, sorted by name, but with where they
came from)
$ oldperl -S pminst -s IO
/usr/lib/perl5/i386-linux/5.00404 IO::File
/usr/lib/perl5/i386-linux/5.00404 IO::Handle
/usr/lib/perl5/i386-linux/5.00404 IO::Pipe
/usr/lib/perl5/i386-linux/5.00404 IO::Seekable
/usr/lib/perl5/i386-linux/5.00404 IO::Select
/usr/lib/perl5/i386-linux/5.00404 IO::Socket
/usr/lib/perl5/i386-linux/5.00404 IO
/usr/lib/perl5/site_perl LWP::IO
/usr/lib/perl5/site_perl LWP::TkIO
/usr/lib/perl5/site_perl Tk::HTML::IO
/usr/lib/perl5/site_perl Tk::IO
/usr/lib/perl5/site_perl IO::Stringy
/usr/lib/perl5/site_perl IO::Wrap
/usr/lib/perl5/site_perl IO::ScalarArray
/usr/lib/perl5/site_perl IO::Scalar
/usr/lib/perl5/site_perl IO::Lines
/usr/lib/perl5/site_perl IO::WrapTie
/usr/lib/perl5/site_perl IO::AtomicFile
The -l flag gives full paths:
$ filsperl -S pminst -l Thread
/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Queue.pm
/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Semaphore.pm
/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Signal.pm
/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread/Specific.pm
/usr/local/filsperl/lib/5.00554/i686-linux-thread/Thread.pm
AUTHORS and COPYRIGHTS
Copyright (C) 1999 Tom Christiansen.
Copyright (C) 2006-2008 Mark Leighton Fisher.
This is free software; you can redistribute it and/or modify it under the terms of either: (a) the GNU General Public License as published
by the Free Software Foundation; either version 1, or (at your option) any later version, or (b) the Perl "Artistic License". (This is the
Perl 5 licensing scheme.)
Please note this is a change from the original pmtools-1.00 (still available on CPAN), as pmtools-1.00 were licensed only under the Perl
"Artistic License".
perl v5.10.1 2010-02-22 PMINST(1p)