I am practicing my sed and regex and am trying to replace all instance of "cheer" with lalaland in the file below, while excluding things like cheering:
ubuntu@ip-172-31-58-40:~$ cat test
cheer
cheering
.
word
cheerytree
acheerytree
ubuntu@ip-172-31-58-40:~$ sed -i "s/cheer[^ing]/lalaland/g" test
ubuntu@ip-172-31-58-40:~$ cat te
cat: te: No such file or directory
ubuntu@ip-172-31-58-40:~$ cat test
cheer
cheering
.
word
lalalandtree
alalalandtree
I don't understand why the first item, cheer, is left along.
Thanks
touch testand thenecho "tes[^x]"vsecho tes[^x].