10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
'Hi
I'm using the following code to extract the lines(and redirect them to a txt file) after the pattern match. But the output is inclusive of the line with pattern match.
Which option is to be used to exclude the line containing the pattern?
sed -n '/Conn.*User/,$p' > consumers.txt (11 Replies)
Discussion started by: essem
11 Replies
2. Shell Programming and Scripting
Dear Unix Forums,
I am hoping you can help me with a pattern matching problem.
What am I trying to do?
I want to replace multiple lines of a text file (that match a multi-line pattern) with a single line of text. These patterns can span several lines and do not always have the same number of... (10 Replies)
Discussion started by: thefang
10 Replies
3. Shell Programming and Scripting
Hi all,
i am trying to count the number of logical processors from the below output:
# print_manifest | grep "logical processors"
8 cores, 16 logical processors per socket
2 logical processors (2 per socket)
i just want to have below output :
16
2
also... (11 Replies)
Discussion started by: omkar.jadhav
11 Replies
4. Shell Programming and Scripting
Hi
I know sed and awk has options to give range of line numbers, but
I need to replace pattern in specific lines
Something like
sed -e '1s,14s,26s/pattern/new pattern/' file name
Can somebody help me in this....
I am fine with see/awk/perl
Thank you in advance (9 Replies)
Discussion started by: dani777
9 Replies
5. Shell Programming and Scripting
Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period.
Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Discussion started by: right_coaster
10 Replies
6. Shell Programming and Scripting
I am trying to find a way to utilise the full potential of my cpu cores and memory on my windows machine.
Now, I am quite familiar with grep, however, running a Unix based OS is not an option right now.
Unfortunately, the 32 bit grep for windows that I am running, I cannot run multiple... (1 Reply)
Discussion started by: Moloch
1 Replies
7. Shell Programming and Scripting
Hi,
Below is my input file:
Data: 1
Length: 20
Got result.
Data: 2
Length: 30
No result.
Data: 3
Length: 20 (7 Replies)
Discussion started by: edge_diners
7 Replies
8. Shell Programming and Scripting
Hi,
Please take a look at the below eg. I would like to search for abc() pattern first and then search for (xyz) in the next line. If I can find the pattern, then I should delete the 3 lines.
I can only find the pattern and delete but I am unable to find two patterns and delete. Any... (8 Replies)
Discussion started by: sreedevi
8 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I'm trying to create a program in perl called myfind.pl;
To use the program:
(at the command line)$ program.pl keyword filename
note: the keyword is any word or regular expression
and it should display the result just like when you 'cat' the file name but with the keyword in... (2 Replies)
Discussion started by: Horizon666
2 Replies
10. Shell Programming and Scripting
Hi All,
Can someone please help me write a script for the following requirement in awk, grep, sed or perl.
Buuuu xxx bbb
Kmmmm rrr ssss uuuu
Kwwww zzzz ccc
Roooowwww eeee
Bxxxx jjjj dddd
Kuuuu eeeee nnnn
Rpppp cccc vvvv cccc
Rhhhhhhyyyy tttt
Lhhhh rrrrrssssss
Bffff mmmm iiiii
Ktttt... (5 Replies)
Discussion started by: kumarn
5 Replies