Mac OS

Question

Formatting text with sed using iTerm2

by pmdulaney / April 14, 2013 8:23 AM PDT

In order to make the results of my sed filtering more visible, I would like, when I replace OLD with NEW to underline NEW. I'm using the tcsh shell. So, what I want is something like:

cat file | sed 's/OLD/NEW/g' | more

but I want NEW to be underlined. If you have an answer please give sufficient detail; i.e., please do not assume I know anything but basic sed. Thanks.

Answer This Ask For Clarification
Discussion is locked
You are posting a reply to: Formatting text with sed using iTerm2
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: Formatting text with sed using iTerm2
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -
Clarification Request
Ascii text?
by R. Proffitt Forum moderator / April 14, 2013 8:27 AM PDT

I've never seen underlining in an Ascii text file. You may have to reveal more.
Bob

Collapse -
Attempt at clarification
by pmdulaney / April 14, 2013 8:41 AM PDT
In reply to: Ascii text?

Well, I'm not sure if it's considered ASCII or not, but iTerm2 can display bolded and underlined text. I would actually want to create two versions of my sed script: one (without the underline feature I'm seeking here) for writing to a new file, and another for viewing with more on the terminal where I could just easily tell what's changed.

Collapse -
I see a forum just for iTerm2 at link.
by R. Proffitt Forum moderator / April 14, 2013 8:51 AM PDT
http://www.iterm2.com/#/section/home

I'm just an old programmer and a text file is, in my definition "ASCII" and as such has no underline. Now there are editors that will underline when they display web links and such but this is not in the source file but in some rules file.
Bob
Popular Forums
icon
Computer Help 47,885 discussions
icon
Computer Newbies 10,322 discussions
icon
iPhones, iPods, & iPads 3,188 discussions
icon
Security 30,333 discussions
icon
TVs & Home Theaters 20,177 discussions
icon
HDTV Picture Setting 1,932 discussions
icon
Phones 15,713 discussions
icon
Windows 7 6,210 discussions
icon
Networking & Wireless 14,510 discussions

Tech Tip

Know how to save a wet phone?

It's not with a dryer and it's not with rice. CNET shows you the secret to saving your phone.