I've been using vi for about 10 years, but this is my first attempt at creating a vi script. I am reformatting some files to create CSVs for import into a database. In the script, I have a bunch of substitute lines that work fine, but I'm trying to figure out how to get the script into insert mode and then back to command mode so I can run commands such as:
d1G
dG
1G
I've tried typing <ESC> into the script, but vi doesn't seem to recognize it. What can I use to switch modes?
What I have is an HTML product catalog that has written text like product descriptions and the like and below it there is product specifications which is what I am grabbing for my database. Basically, I'm just looking to delete the first n lines of the file. However, n is dependent on wherever the written text ends. I can do it easily with vi commands in insert mode, but not command mode. I may just end up writing a macro and calling it from my script for the parts I can't do in command mode.
Requirement: I am writing a shell script which take some file from say Server1 and I have to execute some command on Server2 then I have to manipulate the data and based on that I have to produce report.
Problem:I can schedule the shell script on only one server (Server1 or Server2) So, In the... (3 Replies)
Linux version : Oracle Linux 6.4
Shell : Bash
The following script will be run as root. During the execution, it should switch to oracle user and execute few commands.
After googling and searching within unix.com , I came up with the following syntax
## Enclosing all commands in double... (7 Replies)
Hi,
I have an issue with switching to other directory through shell script. I have used
cd /Music"
but that doesn't help me. Then I have also tried using
alias proj 'Music'
alias
then I get the error permission denied but i set the chmod 777 Music. I am using cShell for my... (3 Replies)
I downloaded vim.7.2 and compiled the vim source .
Added the vim binary path to PATH (Because iam not the root of the box)
when i load the file using vim it throws me an error
Error detected while processing /home2/e3003091/.vimrc:
line 2:
E185: Cannot find color scheme darkblue
line... (0 Replies)
Dear All,
I want to switch a user inside a shell script.My current user say x and user y to whom i want to switch both have login on the same server,the one on which i want to execute my script on.
"I want to do something like this
su - y
Password should be provided in the script itself.And... (6 Replies)
Hi,
I have a shell script in which I need to switch to another user and execute some commands and then come back to the original user.
To make it more clear -
I have to log in as user root then 'su' to jag - execute a script called backup.sh and then logout and come back to root again..
... (1 Reply)
Discussion started by: bjagadeesh
1 Replies
8. Post Here to Contact Site Administrators and Moderators
What are the Guided and Enhanced Modes? This is something new right? Or have I been the most unobservant guy on the face of this planet? At first I thought it was something for Gollum the forumbot, but its there everytime you start a new thread.
What is the difference between the two? And how do... (1 Reply)