# Spell-replace not working

**URL:** <https://discuss.kakoune.com/t/spell-replace-not-working/2014>\
**Category:** Help\
**Created:** [March 18, 2022, 5:30am UTC](https://discuss.kakoune.com/t/spell-replace-not-working/2014 "2022-03-18T05:30:07Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bensnowball](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/b/7bcc69/32.png) [@bensnowball](https://discuss.kakoune.com/u/bensnowball)\
**Post date:** [March 18, 2022, 5:30am UTC](https://discuss.kakoune.com/t/spell-replace-not-working/2014/1 "2022-03-18T05:30:07Z")

</div>

Hi, I’m having trouble with with the `spell-replace` command not showing possible selections. The `*debug*` buffer usually shows the error:

`sed: 1: "/^&/ { s/^[^:]*: //; s/ ...": extra characters at the end of p command`

That error seems to be from [this line](https://github.com/mawww/kakoune/blob/master/rc/tools/spell.kak#L152). Beyond that I can’t work it out. I have `diff`ed it and my version of `spell.kak` is exactly the same as that original. `aspell` is installed and working at least from the command line.  
Thanks in advance, Ben

---

<div class="post-metadata">

**Author:** ![Screwtapello](https://discuss.kakoune.com/user_avatar/discuss.kakoune.com/screwtapello/32/12_2.png) [@Screwtapello](https://discuss.kakoune.com/u/Screwtapello)\
**Post date:** [March 18, 2022, 6:03am UTC](https://discuss.kakoune.com/t/spell-replace-not-working/2014/2 "2022-03-18T06:03:38Z")

</div>

What version of `sed` are you running? If you’re on Linux or Cygwin you’re probably using GNU sed; if you’re on one of the BSDs or macOS you’re probably using BSD sed, unless you’re using Homebrew on macOS in which case it might be GNU sed after all; If you’re on a really minimalist Linux distro like Alpine you might be using BusyBox sed; there’s probably a bunch of other implementations I can’t think of off the top of my head but I’m sure you’d know if you were using one.

Does adding a `;` after `p` on that line fix the problem?

---

<div class="post-metadata">

**Author:** ![bensnowball](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/b/7bcc69/32.png) [@bensnowball](https://discuss.kakoune.com/u/bensnowball)\
**Post date:** [March 18, 2022, 7:50am UTC](https://discuss.kakoune.com/t/spell-replace-not-working/2014/3 "2022-03-18T07:50:16Z")

</div>

Thanks, it is BSD sed (FreeBSD). The extra semicolon seems to stop the error in the `*debug*` buffer, but the command still doesn’t work.  
I forgot to say that it did once work with the same setup, at least nothing that I can think of was changed. Also it’s clearly get through to `aspell` because the `spell` command does correctly highlight mis-spelt words.

---

<div class="post-metadata">

**Author:** ![bensnowball](https://discuss.kakoune.com/letter_avatar_proxy/v4/letter/b/7bcc69/32.png) [@bensnowball](https://discuss.kakoune.com/u/bensnowball)\
**Post date:** [March 18, 2022, 9:40am UTC](https://discuss.kakoune.com/t/spell-replace-not-working/2014/4 "2022-03-18T09:40:48Z")

</div>

Got it partly working with the finial semi-colon and reverting [this change](https://github.com/mawww/kakoune/commit/efb6fca0685c8a22a02a8cfadb8f3f03a86290d0). Now just got to work out what problem that commit solved. Thanks for the help.
