how do execute "vi" commands in shell script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how do execute "vi" commands in shell script?
# 1  
Old 06-11-2009
Error how do execute "vi" commands in shell script?

Hi All,

I need to execute the following "vi" commands in my script. How can I do that??
pls help me....

1. escape (escape mode)
2. gg (goto first line)
3. shift+v (visual mode)
4. shift+g (goto to last line)
5. = (alinment)


Thanks in advance,
Saravana
# 2  
Old 06-11-2009
Follow all the 5 steps and things will be done ^^
# 3  
Old 06-11-2009
thanhdat,

I have to use all the 5 vi commands in my script to do alignment. But I don't know that how can I execute "vi" commands in shell script?
# 4  
Old 06-11-2009
explain with example please.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. AIX

Nim server "Unable to execute remote client commands"

Hello, What is its mean? Could you please help me? Best regards, root@nimserver:/> nimadm -j nimadmvg -c dev4 -s spot1 -l lpp_source1 -d "hdisk7" -Y Initializing the NIM master. Initializing NIM client dev4. 0042-006 c_rsh: (exec_nimsh_cmd) exec_cmd Error 0 poll: setup failure... (2 Replies)
Discussion started by: getrue
2 Replies

3. UNIX for Beginners Questions & Answers

Extract delta records using with "comm" and "sort" commands combination

Hi All, I have 2 pipe delimited files viz., file_old and file_new. I'm trying to compare these 2 files, and extract all the different rows between them into a new_file. comm -3 < sort file_old < sort file_new > new_file I am getting the below error: -ksh: sort: cannot open But if I do... (7 Replies)
Discussion started by: njny
7 Replies

4. Shell Programming and Scripting

"Cannot Execute" script, SunOS. [solved]

I have a script in Server A that will run a script in ServerB. #!/bin/ksh/ ssh user@server "/path/script.sh" The script permissions are as follow: -rwxrwxrwx 1 user dba 75 Jun 11 10:00 script.sh I checked the existence of 'ksh' in /bin and its there. (bash isnt) ... (0 Replies)
Discussion started by: RedSpyder
0 Replies

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

6. Solaris

Relation btw commands, "man" and "more" ???

Hi guys, Hope u r doing find. I have this query. When we check the manual pages for a certain command, say man cat we see the manual page with more What is UNIX really doing here, I mean why not less command instead of more command. And can we have UNIX display the manual pages with less command... (2 Replies)
Discussion started by: gabam
2 Replies

7. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

8. Shell Programming and Scripting

Difficulty using "execute immediate" in shell - Sql script

Hello members, I get an unexpected "end of file" error while trying to execute the following piece of code in the bash / ksh shell. I'm assuming the problem is with using the "execute immediate statement" #! /bin/bash tname="table" for i in * do sqlstr="create table $tname$i as select... (3 Replies)
Discussion started by: novice82
3 Replies

9. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

10. Shell Programming and Scripting

using mutiple "nohup" to execute multiple commands.

I need to run multiple commands on remote server using the nohup... I have tried 2 options 1) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl ; $SCRIPTS_DIR/xyz.ksh & " & 2) rsh <SERVER_NAME> -n "nohup perl $SCRIPTS_DIR/abc.pl & nohup $SCRIPTS_DIR/xyz.ksh & " & I need to know if... (2 Replies)
Discussion started by: aster007
2 Replies
Login or Register to Ask a Question