From: 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: Message-ID: <0e5c2fc463ca61baeed61bb8340a9658@msgid.frell.theremailer.net> Date: Tue, 09 Jul 2024 16:26:11 +0200 Newsgroups: comp.os.linux.misc Path: csiph.com!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 Xref: csiph.com comp.os.linux.misc:56859 Jon Danniken [JD]: JD> 000000 JS> FFFFFF 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'