Hi,
i still new to ubuntu
i trying to find how do i write script in ubuntu using vi editor
but i cant find a way to write it
for example
write a script to list out various script titles and short description of the scripts and allow users to choose which to run?
how i run the scripts after finish the script?
1. How to use vi
__1a. How to start vi
__1b. Using vi
__1c. Saving a file in vi
2. How to write a shell script
__2a. Shebang
__2b. Authoring
3. How to run a shell script
__3a. How to set permissions on a shell script
__3b. Executing the script
vbe addressed 1c, 2a, and 3a. 1b and 2b will require a good deal of time for you to learn (though the basics are easy). As for the others:
You can start vi from the console by typing
Once you have set the permissions for a script, say example.sh, you can run it (from the same directory) with
Homework is not permitted at The UNIX and Linux Forums.
Please read the rules, which you agreed to when you registered, if you have not already done so.
More-than-likely, posting homework has resulting in a forum infraction. If you did not post homework, please explain the company you work for and the nature of the problem you are working on.
I was wondering if it is possible to execute a script that will remove a certain search pattern from a file and save it?
Manually I would just hit escape to enter command mode then search and delete the pattern "./srv 135.0.0.1.11111 210;=1" then save & exit the file
vi command to search and... (3 Replies)
I have an existing shell script that I am trying to modify. I have about 10 lines of info I want to overwrite using text someone emailed to me. I guess what I am trying to do basically is like a copy/paste, but it's not working for me.
I am using Cygwin and vi editor.
I open the script and... (4 Replies)
Hi. I'm having trouble writing a wrapper script for the command line text editor gnu ed.
I want to be able to run the following algorithm on ed:
1. Display, on stdout, a command which I intend to feed into ed (before I actually feed it to ed).
2. Actually feed the command into ed's stdin.... (2 Replies)
p { margin-bottom: 0.08in; } This is just a portion of a script I'm writing on Linux nano script editor. When I run the script I get stuck on the ps -e | less command portion of the script:wall:. It displays all the process running but it does not allow me to move to the next line on the script.... (2 Replies)
Hi all,
I am trying to use the Ex editor and its commands in a script - more specifically within an if statement within a while loop.
Here are the basics of the loop:
cat $file1 | while read line
do
grep $line $file2
if ]
then
echo $line > $file2
elseex $file2
/ESI185... (4 Replies)
Hi,
We have smb client running on two of the linux boxes and smb server on another linux system. During a backup operation which uses smb, read of a file was allowed while write to the same file was going on.Also simultaneous writes to the same file were allowed.Following are the settings in the... (1 Reply)
Hi,
Is there a way to display the stdout of a script using vi editor without writing the stdout to a file.
I have a script (format.sh) which reads a file and displays it in a special format.
i want to see this displayed text using vi editor?
currently i am doing:
format.sh myfile> out.txt... (1 Reply)
Hi All,
I am running a script , working very fine on cmd prompt. The problem is that when I open do crontab -e even after setting editor to vi by
set EDITOR=vi it does not open a vi editor , rather it do as below.....
/////////////////////////////////////////////////////
$ set... (6 Replies)
Hi,
I knw its a silly question, but am a newbie to 'vi' editor. I'm forced to use this, hence kindly help me with this question.
How can i paste a chunk 'copied from' a different editor(gedit) in 'vi editor'?
As i see, p & P options does work only within 'vi'. (10 Replies)