10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all
I got test.test.test and need
test.test\.test *
I need the backslash before the last dot in the line
I tried
echo test.test.test | sed 's/\./\\./g'
but it gives me
test\.test\.test
Thanks (7 Replies)
Discussion started by: stinkefisch
7 Replies
2. UNIX for Dummies Questions & Answers
Hi All,
I have a text file that contains
I1SP2 *=*=Y=M=D001D
My requirement is to replace all occurrence of =* to =Z
expected o/p is I1SP2 *=Z=Y=M=D001D
I have tried with
sed 's/=*/=Z/g' file
sed 's!\=*!\=Z/g' file
sed 's!\=*!\=Z!g' file
sed 's!\=\*!\=Z!g' file
but its not... (3 Replies)
Discussion started by: gotamp
3 Replies
3. Shell Programming and Scripting
Hi,
The command - id | awk '{print $1}' - returns the following:
uid=9028(luke)
What do I need to further that awk so that I only have "luke", I want to set this as a variable.
Thanks in advance,
Lukas.
P.S: I've come up with:
USER1=`id | awk F'(' '{print $2}' | awk -F')' '{print... (4 Replies)
Discussion started by: luke222010
4 Replies
4. Shell Programming and Scripting
Hello
I've got a string of text with a number in pence, e.g. 0.52p, I need to remove the 'p' so that it just reads 0.52 without of course removing all the other 'p' characters.
Many thanks (1 Reply)
Discussion started by: mrpugster
1 Replies
5. OS X (Apple)
To the group, when I copy text from a web page that has the below java code , and then do the set list command in the vi editor, I see the $ symbol at the end of each line. I have searched the internet looking for a way to remove this from the file since it will not compile without errors..Please... (6 Replies)
Discussion started by: smartino
6 Replies
6. Shell Programming and Scripting
I'd like to remove (do a pattern or precise replacement - this I can handle in SED using Regex )
---AFTER THE 1ST Occurrence ( i.e. on the 2nd occurrence - from the 2nd to fourth occurance ) of a specific string : type 1
-- After the 1st occurrence of 1 string1 till the 1st occurrence of... (4 Replies)
Discussion started by: sieger007
4 Replies
7. Shell Programming and Scripting
I have the replace the pattern in the file , ); to );
Could someone please help me to get this command. (2 Replies)
Discussion started by: mohan.bit
2 Replies
8. Shell Programming and Scripting
Greetings,
I am doing something that I don't know if it is possible...
I have a file with a line looks like this:
<%s \n%s / %s \n%s \n>
and I am trying to replace this line with
<%s \n%s \n%s / %s \n%s \n>
in Shell script with sed command...
StringToReplace='%s \n%s / %s \n%s \n'... (2 Replies)
Discussion started by: wasabihowdi
2 Replies
9. Shell Programming and Scripting
Hi
I want to replace ./testsed.ksh
with
testsed.ksh
./ is to be removed
scriptnm=`sed -e 's/\.///' $0
does not work
Please help (3 Replies)
Discussion started by: usshell
3 Replies
10. Shell Programming and Scripting
I have a script that is reading an existing report, pulling out the customer code, then tacking on the customer name from another file and replacing the existing customer code with the new field. This was written for me by someone else. I'm not real familiar with sed.
The data is getting into... (3 Replies)
Discussion started by: MizzGail
3 Replies