Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am looking for a way to automatically insert soft hyphens (­ or unicode character) to hyphenate words into HTML document from command line.

1) What is best way to do so from command line?

2) What are options where it comes to using different dictionaries/rules to word hyphenation? Are there rules for languages other than English?

I am aware that some software, including LibreOffice like decribed in Automatic hyphenation software, have option to apply hyphenation to document, but I am looking for way to do so in already existing HTML document without using word processing software.

share|improve this question

If what you are looking for is to simply replace - with ­, you could just use sed:

sed -i 's/-/\­/g' file.html

The command above will edit file.html and make the replacement you want.

Your other question is not on topic here so I won't go into any depth but yes, different languages often have different hyphenation rules.

share|improve this answer
Thanks, but question was about using command line tool that will detect hyphenation points and insert them, not simply replacing hyphens to soft hyphens. – Rafal Apr 10 '14 at 10:41

Your Answer


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.