Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to type ^A in vi

I am unable to type (Control A) characters in a shell script. By using (Ctrl+V) and then (Ctrl+A). I am unable to do so. I am able to give (Ctrl+A) from cli but not in a shell script. I am typing the shell script in vi.

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

like image 454
Joy Jyoti Avatar asked Jul 04 '14 09:07

Joy Jyoti


People also ask

How do you type special characters in vi?

To insert, type Ctrl + K , followed by 1 and 2 .

How do you type a colon in vi?

To get into it, press Esc and then : (the colon). The cursor will go to the bottom of the screen at a colon prompt. Write your file by entering :w and quit by entering :q . You can combine these to save and exit by entering :wq .


1 Answers

@Joy, If you are using Vi/Vim, just make sure you are in Insert mode and then press (Ctrl+V) followed by (Ctrl+A) to get ^A typed. Sorry, I really don't see why this wouldn't work... Maybe your (Ctrl+V) keypress is caught by some other software layer?

like image 117
jaybee Avatar answered Sep 22 '22 08:09

jaybee