I am trying to execute the next code:
P=$(grep -Ei "^export PATH" "$HOME"/.zshrc)
sed '/'"${P}"'/ a Hello_World' $HOME/.zshrc
But i get the next error:
sed '/'"${P}"'/ a Hello_World' $HOME/.zshrc
sed: can't find label for jump to `in/DevTools/flutter/bin/:$HOME/bin/DevTools/Android/Sdk/platform-tools/:/usr/local/go/bin/'
The objective is append the /usr/local/go/bin, with the existing PATH in the user .*rc (bash,zsh,fish).
other thing is i wanna, make this work with variable, because if the user wanna change the location, will do to the Variable instead of the line.
thanks.