Re: Sed - insert character between tag
- From: Florian Diesch <diesch@xxxxxxxxxxxxx>
- Date: Wed, 16 Dec 2009 01:09:47 +0100
Bruno Galindro da Costa <bruno.galindro@xxxxxxxxx> writes:
Hi all!
I have a text file with this content:
VAR_1="xyz "abcd" fgh"
Using sed, how can I insert a backslash before the two quotes between the
first and last quote?
e.g.: VAR_1="xyz \"abcd\" fgh"
sed -r 's/"/\\"/g;s/\\"/"/;s/(.*)\\"/\1"/'
Maybe there's something more elegant...
Florian
--
<http://www.florian-diesch.de/software/shell-scripts/>
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Sed - insert character between tag
- From: Bruno Galindro da Costa
- Re: Sed - insert character between tag
- References:
- Sed - insert character between tag
- From: Bruno Galindro da Costa
- Sed - insert character between tag
- Prev by Date: Re: RPM and DEB compatibility
- Next by Date: Re: Thread hijacking
- Previous by thread: Re: Sed - insert character between tag
- Next by thread: Re: Sed - insert character between tag
- Index(es):
Relevant Pages
|