10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My variable contains the following string
I wish to replace \n with "space" so the expected output is:
I understand that the /n is not a new linein this case.
I'm on AIX using ksh shell. Below is all that I tried.
echo $str | sed -e "s#\n# #g";
echo $str | sed -e "s#\n#' '#g";... (5 Replies)
Discussion started by: mohtashims
5 Replies
2. Shell Programming and Scripting
I wish to replace "\\n" with a single white space.
The below does the job on command-line:
$ echo '/fin/app/scripts\\n/fin/app/01/sql' | sed -e 's#\\\\n# #g';
/fin/app/scripts /fin/app/01/sql
However, when i have the same code to a shell script it is not able to get me the same output:... (8 Replies)
Discussion started by: mohtashims
8 Replies
3. UNIX for Beginners Questions & Answers
I have a list of value , and need to replace that in my file.
Eg:
File1
tcname:fail
tcname: Pass
tcname:skipped
File2:
01,02,03
Output:
File 1
01:fail
02: Pass
03:Skipped (8 Replies)
Discussion started by: DevAakash
8 Replies
4. UNIX for Beginners Questions & Answers
Hi Guys,
I need to search and replace a string in AIX using variables and should be case insensitive.
I am able to search and replace using below command but its not working as case insensitive.
cat abc.txt | sed -e 's/$a/$b/g' > abc.txt
But i need to perform this with case... (9 Replies)
Discussion started by: mohit_vardhani
9 Replies
5. UNIX for Advanced & Expert Users
Morning,
I'm trying step up my scripting game .. :rolleyes::confused::D
Is there a way to do the replacement with an or without using an external command ?
I did try but no joy.
var=${var//\(|\)/}
#!/bin/bash
var="lulus.UbiRwidgets.com (10.1.1.1)"
var=${var//\(/}... (5 Replies)
Discussion started by: popeye
5 Replies
6. Shell Programming and Scripting
Hi All,
I have been trying to replace a string using the sed command
string value contain blackslash and double quotes. I am not a expert writer of unix script but do try not to ask question. I have almost given up. Hope you all can give me some suggestion
I want to replace a place string... (6 Replies)
Discussion started by: thanush9sep
6 Replies
7. UNIX for Dummies Questions & Answers
I have text file which is a tab delimited one. Sample data from the file is shown below:
unix is\ great\ os
linux\ is superb
I want to replace that backslash with empty string preserving the tab delimiter. Output should be
unix is great os
linux is ... (3 Replies)
Discussion started by: p.akhilreddy4u
3 Replies
8. Shell Programming and Scripting
here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb
cat dump.sql
INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies
9. UNIX for Dummies Questions & Answers
I have value like ABCDEF,BBCCDD in a shell variable, now i would like to have ABQWEF,BBQWDD in the same shell variable. How can i replace the char at position 3&4 with QW in shell script? (3 Replies)
Discussion started by: vel4ever
3 Replies
10. Shell Programming and Scripting
I used the following script
cd pathname
for y in `ls *`;
do sed "s/ABCD/DCBA/g" $y > temp; mv temp $y;
done
and it worked fine for finding and replacing strings with names etc. in all files of the given path.
I'm trying to replace a string which consists of path (location of file)
... (11 Replies)
Discussion started by: pharos467
11 Replies