Remove all matches containing a string until its next space
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)
EXAMPLE:
From this text:
Get this:
It is meant to be run on Ubuntu, so use bash, sed, awk, etc... the linux versions and if possible posix for any system (cygwin, etc) better.
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 03-25-2019 at 03:27 PM..
Reason: Changed QUOTE to CODE tags.
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 HPUX
evmeventnamematchstr
EvmEventNameMatch(3) Library Functions Manual EvmEventNameMatch(3)NAME
EvmEventNameMatch(), EvmEventNameMatchStr() - match EVM event name
SYNOPSIS
Library
EVM Support Library
Parameters
pattern The event name pattern sought. The pattern may be any valid event name string. It may include wildcard characters in place
of any component.
event The event containing the event name to be compared against the pattern.
match The result of the match. This operand is set to if the name matches the pattern, and to if it does not.
candidate A character string to be matched against the pattern
DESCRIPTION
Because special matching rules apply when deciding whether a candidate event name matches a known name, the EVM name matching functions
should be used for matching purposes, rather than the C string comparison functions The EVM functions match an event name against a sup-
plied pattern, ignoring any trailing appended components in the candidate name, and correctly matching wildcard characters.
The function takes an event and an event name pattern as input, and returns an indication of whether the event contains a name which
matches the pattern in the match output argument. The pattern may be any valid event name string, and may also include wildcard characters
in place of any component. A wildcard in the pattern matches zero or more name components. A matches exactly one component. A match
occurs if the event name matches all components indicated by the pattern, even if the name has additional trailing elements.
The function performs the same check as but takes a character string as the candidate event name, instead of extracting the candidate event
name from a supplied event.
Both functions set the match output argument to if the name matches the pattern, and to if it does not.
RETURN VALUE
The operation completed without error. The comparison was successful. The value of the match operand indicates whether the name matches
the pattern.
One of the arguments to the function is invalid.
The supplied pattern contains invalid characters.
The supplied event does not contain a name.
ERRORS
The value of is not set.
SEE ALSO
Routines
memccpy(3C), strcat(3C).
Event Management
EVM(5).
EVM Events
EvmEvent(5).
EvmEventNameMatch(3)