Unable to replace ^


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unable to replace ^
# 1  
Old 03-16-2018
Unable to replace ^

Hi Team,

I have a file called aa.txt and here's the content

Code:
^aa^,^11^

We are unable to replace the "^" with '' using sed command.

Code:
sed 's/^//g' aa.txt

need the file as follows in AIX
aa,11

Please advise.

Last edited by vgersh99; 03-16-2018 at 12:56 PM..
# 2  
Old 03-16-2018
Code:
echo '^aa^,^11^' | sed 's#\^##g'

# 3  
Old 03-16-2018
Code:
tr -d '^' < file

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Unable to replace 0.0.0.0 in a file

Hi All, i am trying to replace 0.0.0.0 in below file. but i am not able to replace it. File : Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name tcp 0 0 127.0.0.1:25 0.0.0.0:* ... (1 Reply)
Discussion started by: sravani25
1 Replies

2. Shell Programming and Scripting

Unable to replace string in AIX ksh shell

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

3. UNIX for Beginners Questions & Answers

awk script to extract a column, replace one of the header and replace year(from ddmmyy to yyyy)

I have a csv which has lot of columns . I was looking for an awk script which would extract a column twice. for the first occurance the header and data needs to be intact but for the second occurance i want to replace the header name since it a duplicate and extract year value which is in ddmmyy... (10 Replies)
Discussion started by: Kunalcurious
10 Replies

4. UNIX for Dummies Questions & Answers

How can I replace the lines that start with a star and replace it with numbers start from 1?

I need to replace the (*) in the fist of a list with numbers using sed for example > this file contain a list * linux * computers * labs * questions to >>>> this file contain a list 1. linux 2. computers 3. labs 4. questions (7 Replies)
Discussion started by: aalbazie
7 Replies

5. Solaris

Unable to do su -

Hi, when I try to do " su - oradba" on my solaris box i get following error: Please let me know the proabbale cause and resolution to this. ===================== su - oradba Enter Local Unix Password: Login Error ----------- The user 'oradba' is not allowed to log direct into this host.... (2 Replies)
Discussion started by: Laxxi
2 Replies

6. Solaris

Unable to use df -h

Hi , On one of my solaris server I getan error whenever I use df -h as below. df: unknown option: h Usage: df But this works on other servers.Please advise. Regards, VN (2 Replies)
Discussion started by: narayanv
2 Replies

7. Shell Programming and Scripting

Replace dashes positions 351-357 & 024-043 with 0 & replace " " if exis with 04 at position 381-382

I need to replace dashes (i.e. -) if present from positions 351-357 with zero (i.e. 0), I also need to replace dash (i.e “-“) if present between position 024-043 with zero (i.e. 0) & I replace " " (i.e. 2 space characters) if present at position 381-382 with "04". Total length of record is 413.... (11 Replies)
Discussion started by: lancesunny
11 Replies

8. Shell Programming and Scripting

SED - Unable to replace with <tab>

Hello All, I have this file with the below contents 1|2|3|4| this|that|which|what| when I use, sed 's/|/\t/g' infile I get, 1t2t3t4t thistthattwhichtwhatt Why is this?? :confused: :wall: (13 Replies)
Discussion started by: PikK45
13 Replies

9. Shell Programming and Scripting

awk - replace number of string length from search and replace for a serialized array

Hello, I really would appreciate some help with a bash script for some string manipulation on an SQL dump: I'd like to be able to rename "sites/WHATEVER/files" to "sites/SOMETHINGELSE/files" within the sql dump. This is quite easy with sed: sed -e... (1 Reply)
Discussion started by: otrotipo
1 Replies

10. Forum Support Area for Unregistered Users & Account Problems

Unable to

Unable to Activate ErnieS email id removed It just keeps sending me round in circles? And in true Unix fashion as soon as I post this it does.... Please ignore Thanks (1 Reply)
Discussion started by: ErnieS
1 Replies
Login or Register to Ask a Question