Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I wanted to answer http://unix.stackexchange.com/questions/3043/use-roff-to-underline-words with "just use ul, this command is meant specifically for underlining text", however I just can't grasp how to use it. I thought

$ echo "hello _kitty_ world" > /tmp/foo.txt
$ ul /tmp/foo.txt

would give me an underlined "kitty", however it doesn't. What am I doing wrong?

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

The input format requires character-backspace-underscore or character-backspace-letter to underline a character. You also get boldface with character-backspace-character.

echo $'hello k\b_i\b_t\b_t\b_y\b_ world' | ul

Less does a similar transformation automatically.

share|improve this answer
    
To enter Backspace in vim, press [strg] + [v] in INSERT mode and then enter 08. –  echox Oct 12 '10 at 22:02
    
_\bf_\bo_\bo will also work. –  echox Oct 12 '10 at 22:04
1  
@echox: for the non-Germanophones in the audience, that's Ctrl+V. And a handier way is Ctrl+V Ctrl+H (Ctrl+V Backspace may or may not give the right character depending on your terminal configuration.) –  Gilles Oct 12 '10 at 22:13
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.