10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi Everyone,
I want to find this 2 strings in a single line a file and replace the second string.
this is the line i need to find
<param name="user" value="CORE_BI"/>
find user and CORE_BI and replace only CORE_BI with admin
so finally the line should look like this.
<param... (5 Replies)
Discussion started by: shajay12
5 Replies
2. Shell Programming and Scripting
Hello..
I am currently learning sed and have found myself in some trouble..
I wrote this command:
sed -ne 's/*\(\{2\}*\{2\}*\{2\}*\).*\(\{2\}*\{2\}*\{2\}*\).*/\1\2/p'
and some of the output i get is :
->stockholm->paris<-stockholmpi<-tokyo->paris<-stockholmpi... (8 Replies)
Discussion started by: jozo95
8 Replies
3. Shell Programming and Scripting
Hi guys, I wonder if it's possible to search for a line containing 2 strings and delete that line and perhaps replace the source file with already deleted line(s).
What I mean is something like this:
sourcefile.txt
line1: something 122344 somethin2 24334 45554676
line2: another something... (6 Replies)
Discussion started by: netrom
6 Replies
4. Shell Programming and Scripting
Hi,
I have a text file containing 2 lines as follows:
I'm trying to extract all the strings following an "AME." The output would be as follows:
BUSINESS_UNIT
PROJECT_ID
ACTIVITY_ID
RES_USER1
RESOURCE_ID_FROM
ANALYSIS_TYPE
BI_DISTRIB_STATUS
BUSINESS_UNIT
PROJECT_ID
ACTIVITY_ID... (5 Replies)
Discussion started by: simpletech369
5 Replies
5. Shell Programming and Scripting
Dear expert,
I need an urgent help.
I would like to update my /etc/ntp.conf file using sed.
1) if script find this string "127.127.1.0" then add the lone below
#server 127.127.1.0
2) is script find this string "fudge 127.127.1.0 stratum 10" then add
#fudge 127.127.1.0 stratum 10 ... (7 Replies)
Discussion started by: lamoul
7 Replies
6. Shell Programming and Scripting
Hey everyone!
Simple question - I am trying to use sed to replace two different strings. As it stands I can implement this as:
sed -i 's/TIMEOUT//g'
sed -i 's/null//g'
And it works. However, is it possible to shrink that down into a single command? Will there be any performance benefits? (3 Replies)
Discussion started by: msarro
3 Replies
7. Shell Programming and Scripting
Input:
The the
the the
Output:
not-same
same
What would be the sed command to do this? (7 Replies)
Discussion started by: cola
7 Replies
8. Shell Programming and Scripting
Hey folks
I have a big file that contains junk data between the tags <point> and </point> and I need to delete it (including `<point>' and `</point>').
i.e.
a = 1
<point>
123123
2342352
234231
234256
</point>
print a
needs to become
a = 1
print a
I'm certain that this is a... (10 Replies)
Discussion started by: ksk
10 Replies
9. Shell Programming and Scripting
Hello i need some help with the usage of sed.
Situation : 2 textfiles, file.in , file.out
In the first textfile which is called file.in are the words for the substitution.
Every word is in a new-line like :
Firstsub
Secondsub
Thridsub
...
In the second textflie wich is called file.out is... (5 Replies)
Discussion started by: Kingbruce
5 Replies
10. Shell Programming and Scripting
hi
sed -e '/<group>/!s/group\(.*\)/group\: files compat/' /etc/nsswitch.conf
returns
group: files compat
netgroup: files compat
How to prevent changing netgroup entry??
thank you (1 Reply)
Discussion started by: melanie_pfefer
1 Replies