Cannot type ^ A in vi

I cannot type (Control A) characters in a shell script. Using (Ctrl + V) and then (Ctrl + A). I can not do it. I can give (Ctrl + A) from cli, but not in the shell script. I am typing a shell script in vi.

What I'm trying to do is write a shell script containing the command sed 's/^A//g' , i.e. trying to replace (Ctrl + A) with NULL.

+6
source share
2 answers

@Joy. If you are using Vi / Vim, just make sure you are in Insert mode, and then press (Ctrl + V) and then (Ctrl + A) to get ^ A. Sorry, I really don't understand why this will not work ... Maybe your (Ctrl + V) click on some other program level?

+5
source

This works for me:

 cat file This is a test ^A more data sed 's/\^A//g' file This is a test more data 
0
source

Source: https://habr.com/ru/post/971755/


All Articles