From 0c6ad7c52bca1bb09b84bbe0e86b1ddd5f80998c Mon Sep 17 00:00:00 2001 From: rallyemax Date: Mon, 20 Sep 2021 15:30:11 -0600 Subject: [PATCH] Fix sed commands (#2071) In GNU `sed`, the `-iEe` argument is equivalent to `--in-place=Ee`, which would create `~/.profileEe` as backup of `~/.profile` if the command executed successfully. However, because the `e` is no longer being processed as an expression argument, `sed` does not correctly join the expressions and exits with `sed: -e expression #2, char 10: unexpected }`. The intent is to use extended regex, perform the changes in-place, and use a series of expressions, so `-Ei -e` is used instead. --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 88a5045c..1a7ebf99 100644 --- a/README.md +++ b/README.md @@ -239,7 +239,7 @@ easy to fork and contribute any changes back upstream. ~~~bash # the sed invocation inserts the lines at the start of the file # after any initial comment lines - sed -iEe '/^([^#]|$)/ {a \ + sed -Ei -e '/^([^#]|$)/ {a \ export PYENV_ROOT="$HOME/.pyenv" a \ export PATH="$PYENV_ROOT/bin:$PATH" @@ -253,7 +253,7 @@ easy to fork and contribute any changes back upstream. - **If your `~/.bash_profile` sources `~/.bashrc` (Red Hat, Fedora, CentOS):** ~~~ bash - sed -iEe '/^([^#]|$)/ {a \ + sed -Ei -e '/^([^#]|$)/ {a \ export PYENV_ROOT="$HOME/.pyenv" a \ export PATH="$PYENV_ROOT/bin:$PATH"