10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi guys,
I'm wondering what the best way would be to reverse words in a string based on certain characters.
For example:
echo Word1Word2Word3Word4 | sed '
/\n/ !G
s/\(Word.\)\(.*\n\)/&\2\1/
//D
'
This returns:
Word4Word3Word2Word1
I'm no sed expert but... (2 Replies)
Discussion started by: Subbeh
2 Replies
2. Shell Programming and Scripting
Hello,
I need to tail -f a file output stream and I need to get only lines that contains "get" and "point" in the same line. It doesn't matter the order.
Then I need only the text BEFORE "point".
I have to count each line and perform other serveral actions after this has performed 3 times.... (9 Replies)
Discussion started by: Kibou
9 Replies
3. Shell Programming and Scripting
Hi. I have to swap the first and the third word in all lines of a txt file using sed.
Separators between words are: any charachter, except intervall.
I hope, you'll understand what I want to do. my english is not so good, sorry for that:) (10 Replies)
Discussion started by: T720
10 Replies
4. Shell Programming and Scripting
I have a file that contains the schedule for a tournament with 41 teams. The team names have spaces in them. I would like to search for each teams schedule and then save that to that teams file
For example
Team name: "Team Two"
I would like to search for all the games for "Team Two" and... (8 Replies)
Discussion started by: knijjar
8 Replies
5. Shell Programming and Scripting
Hi,
By using shell scripit i have save output in one file. I want to grep two words named CLUSTER and CLUSQMGR from that output file. How to grep that. output file would be having below words
TYPE(QCLUSTER) ALTDATE(2010-05-17)
CLUSTER(QS.CL.MFT1) ... (5 Replies)
Discussion started by: darling
5 Replies
6. Shell Programming and Scripting
Hi all,
I want to make an script using sed that removes everything between 'begin' (including the line that has it) and 'end1' or 'end2', not removing this line.
Let me paste an 2 examples:
anything before
any string begin
few lines of content
end1
anything after
anything before
any... (4 Replies)
Discussion started by: meuser
4 Replies
7. UNIX for Dummies Questions & Answers
OK, let's say if we want to filter lines in man and get a different color for the word we are searching we write man find | grep print
It will mark all the words containing print red and output only those lines containing it, let's say I want to see the complete manual, but with marked words... (1 Reply)
Discussion started by: arcelivez
1 Replies
8. Shell Programming and Scripting
Hi all,
I have a file like
one two three for
five six seven eight
.....
Actually i need to append a label to the words that belong to the 2 column and get:
one two_label three for
five six_label seven eight
....
I was trying with sed inside vim but I can't figure out... (9 Replies)
Discussion started by: Dedalus
9 Replies
9. Shell Programming and Scripting
I've following sed command working fine -
sed '/search_pattern1/ !s/pattern1/pattern2/" file
Now, I want to search two patterns - search_pattern1 and search_pattern2 .
How can put these into above sed statement ?
Thanks in advance. (12 Replies)
Discussion started by: ajitkumar2
12 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have the following codes below that aims to delete every words between two pattern word. Say I have the files
To delete every word between WISH_LIST=" and " I used the below codes (but its not working):
#!/bin/sh
sed '
/WISH_LIST=\"/ {
N
/\n.*\"/ {... (3 Replies)
Discussion started by: Orbix
3 Replies