1

Executing this command:

sed -e 's/á/\á/g' ./source_file > ./destiny_file

Shows this error:

sed: -e expression #1, char 14: unterminated `s' command

Sentence is a part of an .sh file.

I had tried on several shells: sh/bash/sch

And the result is the same.

7
  • On my system (Debian wheezy LTS, all patches applied), it runs without error message, and it does the right thing. Commented Nov 17, 2017 at 13:37
  • Also asked in SO.es, also could not reproduce in my GNU sed 4.2.2. Commented Nov 17, 2017 at 13:53
  • What happens, if you replace the á by, say a (just for testing). Still a syntax error? Commented Nov 17, 2017 at 14:12
  • @user1934428, maybe this is the problem. With "a" the error disappears. Commented Nov 17, 2017 at 14:31
  • 1
    I put "sed -e 's/\xE1/\á/g' ./source_file > ./destiny_file" and works perfectly! Thanks to all! Commented Nov 17, 2017 at 14:36

1 Answer 1

2

The solution was to codify "á" as "xE1":

sed -e 's/\xE1/\&#225\x3B/g'

This works ok!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.