Thank you for being a valued part of the CNET community. As of December 1, 2020, the forums are in read-only format. In early 2021, CNET Forums will no longer be available. We are grateful for the participation and advice you have provided to one another over the years.

Thanks,

CNET Support

Question

Formatting text with sed using iTerm2

Apr 14, 2013 8:23AM 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.

Discussion is locked

- Collapse -
Clarification Request
Ascii text?
Apr 14, 2013 8:27AM PDT

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

- Collapse -
Attempt at clarification
Apr 14, 2013 8:41AM PDT

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.
Apr 14, 2013 8:51AM 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