Sponsored Content
Top Forums Shell Programming and Scripting remove caret (^) symbol from pattern using sed Post 302671421 by goodbenito on Friday 13th of July 2012 12:19:06 PM
Old 07-13-2012
remove caret (^) symbol from pattern using sed

Hi,

I am trying to remove the caret symbol from a bash variable. This is the variable:
Code:
var="GOTAN^TOK^B"

and this is the code I am trying to use to remove the caret symbol:
Code:
nocarrot=`echo $var | sed -e 's/^/_/g'`

This is the output intended (but not acheived with the above function):
Code:
GOTAN_TOK_B

Please help. Thanks in advance.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

sed remove everything up to the pattern

I have been search all over the internet to find a solution to this. I have a file that looks like: -a ItemConfig.custom=true -a Config.custom=true go -t malu -t Use=true I want to get "malu" as output, and the werid thing is the blank before go is neither space nor tab. what's the sed... (4 Replies)
Discussion started by: katrvu
4 Replies

2. Shell Programming and Scripting

SED: how to remove newline after pattern?

Hi, I have the following XML not well-indented code: <hallo >this is a line </hallo> So I need to remove the newline. This syntax finds what I need to correct, but I don't know how to remove the newline after my pattern: sed 's/<.*$/&/' How can I subtract the newline after my... (1 Reply)
Discussion started by: nico.ben
1 Replies

3. Shell Programming and Scripting

remove pattern with sed

Hi, i want to remove a certain pattern when i type pwd. pwd will look like this: ..../....../....../Pat_logs/..../....../...../...... the dotted lines are just random directory names, i want it to remove the "Pat_logs/...../....../....../" part so for example: ... (5 Replies)
Discussion started by: a27wang
5 Replies

4. Shell Programming and Scripting

[solved] remove pattern with sed

Hi, i want to remove a certain pattern when i type pwd. pwd will look like this: ..../....../....../Pat_logs/..../....../...../...... the dotted lines are just random directory names, i want it to remove the "Pat_logs/...../....../....../" part so for example: ... (8 Replies)
Discussion started by: a27wang
8 Replies

5. Shell Programming and Scripting

Need an awk / sed / or perl one-liner to remove last 4 characters with non-unique pattern.

Hi, I'm writing a ksh script and trying to use an awk / sed / or perl one-liner to remove the last 4 characters of a line in a file if it begins with a period. Here is the contents of the file... the column in which I want to remove the last 4 characters is the last column. ($6 in awk). I've... (10 Replies)
Discussion started by: right_coaster
10 Replies

6. UNIX for Dummies Questions & Answers

caret symbol

Hi! I need to know where is the caret symbol (^) on the keyboard. I press Shift+6 and does not appear!! Thank you very much. Removed email address - all should benefit of an answer. (1 Reply)
Discussion started by: labultet
1 Replies

7. Shell Programming and Scripting

Awk-sed help : to remove first and last line with pattern match:

awk , sed Experts, I want to remove first and last line after pattern match "vg" : I am trying : # sed '1d;$d' works fine , but where the last line is not having vg entry it is deleting one line of data. - So it should check for the pattern vg if present , then it should delete the line ,... (5 Replies)
Discussion started by: rveri
5 Replies

8. Shell Programming and Scripting

sed - remove space and . for a pattern

Hi, I have file which contains following lines A| 965.|Mr.|35.45| 66. B| 33.| a456.| 77. The output should be A|965|Mr.|35.45|66 B|33| a456.|77 Basically if a Number has space in prefix and . in suffix remove both. So pattern could be if there is a | which has next two characters as... (1 Reply)
Discussion started by: wahi80
1 Replies

9. Shell Programming and Scripting

sed to remove newline chars based on pattern mis-match

Greetings Experts, I am in AIX; I have a file generated through awk after processing the input files. Now I need to replace or remove the new-line characters on all lines that doesn't have a ; which is the last character on the line. I tried to use sed 's/\n/ /g' After checking through the... (6 Replies)
Discussion started by: chill3chee
6 Replies

10. Shell Programming and Scripting

sed to remove next 15 lines after pattern in Solaris

Team, I am trying to use sed to delete 15 lines, after pattern patch, which includes the pattern as well in Solaris. I used the below command, as we do it Linux, but it's not working as expected in Solaris. I am getting the error as "garbled".sed '/\/table/,+15d' status.html sed: command... (8 Replies)
Discussion started by: Nagaraj R
8 Replies
widget_toolbar(n)					    widget::toolbar Megawidget						 widget_toolbar(n)

__________________________________________________________________________________________________________________________________________________

NAME
widget_toolbar - widget::toolbar Megawidget SYNOPSIS
package require Tcl 8.4 package require Tk 8.4 package require widget ?3.0? package require widget::toolbar ?1.0? widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? _________________________________________________________________ DESCRIPTION
This package provides a toolbar megawidget (snidget). It makes use of the Tile/Ttk themed widget set. widget::toolbar pathname ?options? getframe add ?item? ?args? delete item1 ?item2? ?...? itemcget symbol option itemconfigure symbol ?args? items ?pattern? remove ?-destroy? item1 ?item2? ?...? WIDGET OPTIONS
-ipad -pad -separator ITEM OPTIONS
-pad -separator -sticky -weight EXAMPLE
package require widget::toolbar ; # or widget::all set t [widget::toolbar .t] pack $t -fill x -expand 1 $t add button [button .b -text foo] $t add separator -pad {2 4} $t add button [button .c -text bar] KEYWORDS
megawidget, snit, widget widget 3.0 widget_toolbar(n)
All times are GMT -4. The time now is 08:02 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy