Rocksolid Light

News from da outaworlds

mail  files  register  groups  login

Message-ID:  

BOFH excuse #107: The keyboard isn't plugged in


comp / comp.os.linux.misc / Re: How can I use sed to insert a character into a file?

SubjectAuthor
o Re: How can I use sed to insert a character into a file?Fritz Wuehler

1
Subject: Re: How can I use sed to insert a character into a file?
From: Fritz Wuehler
Newsgroups: comp.os.linux.misc
Organization: dizum.com - The Internet Problem Provider
Date: Tue, 9 Jul 2024 14:26 UTC
References: 1
From: fritz@spamexpire-202407.rodent.frell.theremailer.net (Fritz Wuehler)
Subject: Re: How can I use sed to insert a character into a file?
MIME-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
References: <v6hc36@dont-email.me>
Message-ID: <0e5c2fc463ca61baeed61bb8340a9658@msgid.frell.theremailer.net>
Date: Tue, 09 Jul 2024 16:26:11 +0200
Newsgroups: comp.os.linux.misc
Path: eternal-september.org!news.eternal-september.org!feeder3.eternal-september.org!news.mixmin.net!news2.arglkargh.de!alphared!sewer!news.dizum.net!not-for-mail
Organization: dizum.com - The Internet Problem Provider
X-Abuse: abuse@dizum.com
Injection-Info: sewer.dizum.com - 2001::1/128
View all headers

Jon Danniken <nones...@nottodaynortomorroreither.org> [JD]:
JD> <type:color>000000</type:color>
JS> <type:color>FFFFFF</type:color>

JD> the tags are hex colors ... but need to begin with a pound sign (#)

# append a pound sign after the first instance of ">"
< file sed 's@>@&#@'

Or, if you are a fan of 'awk'

# replace the first instance of ">" with ">#" and print the line
< file awk '{sub(">",">#")}1'

1

rocksolid light 0.9.8
clearnet tor