10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
my file is :
hello1
hello2
hello3_B,dummy,N
Need to change to :
hello1
hello2
hello3_B,dummy_01,N
Can anyone help? Thank you.
Please use code tags next time for your code and data. (6 Replies)
Discussion started by: Alyssa
6 Replies
2. Shell Programming and Scripting
Hi,
I have a file i which i want to replace {gIntegraHost} to {gTestRunHost} between <TCPSampler and curl only.
I am firing below command
sed '1,/<TCPSampler/!{ /curl/,/<TCPSampler/!s/{gIntegraHost}/{gTestRunHost}/; }' file1
But only on instance is getting replaced not all.
Any idea how... (6 Replies)
Discussion started by: abhitanshu
6 Replies
3. Shell Programming and Scripting
Hi all,
Sed is the one which always trobules me :(
here is my input :
*** it industry need to be evolved *** in the world and hope so *** to be dream
the output i am expecting is :
*** it industry need to be evolved
*** in the world and hope so
*** to be dream
... (4 Replies)
Discussion started by: panyam
4 Replies
4. Shell Programming and Scripting
Hi,
I have a line something like this
sys,systematic,system
I want to replace only the word system with HI
I used sed for this as below
echo sys,systematic,system | sed 's/system/HI/'
but I got output as
sys,HIatic,system
I wanted output as
sys,systematic,HI
Please tell me... (9 Replies)
Discussion started by: friendyboy
9 Replies
5. Solaris
Need to replace hard drive on Ultra 10 running Solaris 2.6.
Bought new drive about the same size.
Partitioned it differently to solve a space problem.
After newfs used tar commands to copy most of the files to the new drive.
Installboot took care of the boot file.
ufsdump copied /dev and... (3 Replies)
Discussion started by: snorkack59
3 Replies
6. Shell Programming and Scripting
Hi there,
How can I run a script being sure that it runs all the way to the end even if the source file is deleted or replaced while running?
Actually, I have a script that runs daily on several servers. It replaces local files by updates from a master server. But I'd like it to replace itself... (3 Replies)
Discussion started by: chebarbudo
3 Replies
7. Shell Programming and Scripting
Hi all,
I have a script which uses sed to replace one string with another. The problem is, the string to be matched, and its replacement are coming in as two command line arguments $1 and $2
$1 and $2 can be absolutely anything, but both should be treated purely as strings. My sed command... (7 Replies)
Discussion started by: mark007
7 Replies
8. UNIX for Dummies Questions & Answers
Hi all,
I have a script which uses sed to replace one string with another. The problem is, the string to be matched, and its replacement are coming in as two command line arguments $1 and $2
$1 and $2 can be absolutely anything, but both should be treated purely as strings. My sed command... (1 Reply)
Discussion started by: mark007
1 Replies
9. Shell Programming and Scripting
Hi,
I have a file with the path of the directory present somewhere in it.I have assigned the path of the directory name to a variable. I want to replace it with another string.The code i used was
sed -e '/$variable/sbcd/' filename.
since the path name includes slashes '/', my sed command... (9 Replies)
Discussion started by: ragavhere
9 Replies
10. Shell Programming and Scripting
I have three files that the string inside it I want to replace
so my code will be
#!/bin/bash
read -p "please input the old string:" string1
read -p "please input the new string:" string2
sed -i "s/string1/string2/g" *.c
but the problem is.. the string that I want to replace can't be... (2 Replies)
Discussion started by: Viken
2 Replies