vgersh99 already answered your question but you might want to know why your code didn't work:
Quote:
Originally Posted by baris35
I tried:
Well, s/\[// replaces an opening bracket with nothing (effectively deleting it) and the other substitution does the same with closing brackets. This is why only the brackets are removed, but not what they enclose.
vgersh99s code searches for an opening bracket, followed by any number of not-closing-bracket-characters, followed by a closing bracket and removes this.
hello Friend,
In hostgroup file, i have define lots of hostgroups. I need to remove few of them without manually editing file. Need script or syntax.
I want to search particular on hostgroup_members and delete hostgoup defination of it.
for example.
define hostgroup{
hostgroup_name... (8 Replies)
hello.
How to remove all characters in a line from first character ( a $ ) until and including the third occurrence of that character ( $ ).
Any help is welcome. (10 Replies)
I am learning SED and just following the shell scripting book, i have trouble understanding the grep and sed statement,
Question : 1
__________
/opt/oracle/work/antony>cat teledir.txt
jai sharma 25853670
chanchal singhvi 9831545629
anil aggarwal 9830263298
shyam saksena 23217847
lalit... (7 Replies)
Is this possible? The below code not working for me.
dir=mydir
if ; then
echo "found /home/$mydir "
else
echo "Not found /home/$mydir"
fi
---------- Post updated at 05:28 AM ---------- Previous update was at 05:25 AM ----------
Its working for me now (1 Reply)
Hi
I have to remove in a file in first column whatever is written in brackets with brackets
so one file
hgfd 123
gfhdj 483
jdgfdg 34738
the output shuld be
hgfd 123
gfhdj 483
jdgfdg 34738 (9 Replies)
Hi
I have a file which has aroun 200 line and it is like this:
GROUP2-WDI">GROUP2-WDI
GROUP3-WDI">GROUP3-WDI
KL2P0508BC">KL2P0508BC
KL2P0508BIT">KL2P0508BIT
KL3P0506BC">KL3P0506BC
KL3P0506BUS">KL3P0506BUS
KLD1F0507DBT">KLD1F0507DBT
KLD1F0507DIT">KLD1F0507DIT
KLD1F0510DBT">KLD1F0510DBT... (3 Replies)
I have the following line:
4/23/2010 0:00:38.000: Copying $$3MSYDDC02$I would like to use sed (or similiar) to remove everthing between and including $ that appears in the line so it ends up like this.
4/23/2010 0:00:38.000: Copying 3MSYDDC02I have been trying these but i'm really just... (5 Replies)
This is my first post, please be nice. I have tried to google and read different tutorials.
The task at hand is:
Input file input.txt (example)
abc123defhij-E-1234jslo
456ujs-W-abXjklp
From this file the task is to grep the -E- and -W- strings that are unique and write a new file... (5 Replies)
How to use sed to remove html tags including text between them?
Example: User <b> rolvak </b> is stupid. It does not using <b>OOP</b>!
and should output: User is stupid. It does not using !
Thank you.. (2 Replies)