10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi All,
I need one help to replace particular words in file based on if finds another words in that file .
i.e.
my self is peter@king.
i am staying at north sydney.
we all are peter@king.
How to replace peter to sham if it finds @king in any line of that file.
Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
2. Shell Programming and Scripting
I am looking for a sed in which I can recognize all of the text in between two indicators and then replace it with a place holder.
For instance, the 1st indicator is a list of words "no|noone|havent" and the 2nd indicator is a list of punctuation ".|,|!".From a sentence such as
"noone... (3 Replies)
Discussion started by: owwow14
3 Replies
3. UNIX for Dummies Questions & Answers
Hello,
I would like to change my setting in a file to the setting that user input.
For example, by default it is
ONBOOT=ON
When user key in "YES", it would be
ONBOOT=YES
--------------
This code only adds in the entire user input, but didn't replace it.
How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies
4. Shell Programming and Scripting
Hi All,
I have a requirement to find and replace old date with new date value. Below is the scenario:
# In the input file, date is MM/DD/YYYY format
PREV_DTE=09/15/2013
I want to replace with 09/30/2013. It should look like
PREV_DTE=09/30/2013
I am using below sed command :... (4 Replies)
Discussion started by: rockygsd
4 Replies
5. Shell Programming and Scripting
Hi all ,
I have to write a shell script that takes a number as input , like 123
and the output will be 6 ,i.e the output will be the sum of digits of the input.
I have an idea as follows,
echo "123"|fold -1|tr '\n' '+'|bc
But the problem is after " echo "123"|fold -1|tr '\n' '+' "... (5 Replies)
Discussion started by: M.Choudhury
5 Replies
6. Shell Programming and Scripting
hello,
i 'd like your help about a bash script which:
1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel,
2.finds the link which leads to the download location of the Latest Stable Kernel version,
(the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies
7. UNIX for Dummies Questions & Answers
Hello guys,
I'm trying to replace the word "i.e." for "ie." in Vi but everytime I used the search tool for start looking for it (this is: /i.e.), it finds every word that contains the "i" and "e" word. I tried the following command:
:%s/i.e./ie./g
However, it doesn't work.
Any help... (2 Replies)
Discussion started by: Gery
2 Replies
8. Shell Programming and Scripting
Hi All,
I don't know what I am doing wrong in the regex below.
I have the following string:
31000000010201005181121360000000100000000003000000YYY-YYY-YYY-20100518-104139.txt.YYY
I need to split it in parts:
- Group 1: 3100000001020100518112136
- Group 2: 000000010
- Group 3:... (0 Replies)
Discussion started by: felipe.vinturin
0 Replies
9. UNIX for Dummies Questions & Answers
hi,
I need to replace all these lines from my text file
123end
234end
324end
234end
989end
258end
924end
At the moment I know how to replace "end". But I want to replace the numbers before end as well. How can I do this ?
sed s/end/newWord/ myfile.txt newFile.txt
thanks (3 Replies)
Discussion started by: aneuryzma
3 Replies
10. UNIX for Dummies Questions & Answers
lets see if i can explain this in a good way.
im trying to replace some words in a file but i need to know what the words are that is beeing replaced. not sure if sed can do this.
file.name.something.1DATA01.something.whatever
sed "s/./.DATA?????/g"
need to know what the first . is... (2 Replies)
Discussion started by: cas
2 Replies