Skip to main content

ads1

Chapter :- 7 Vim Editor and Basic Scripting

 Chapter :- 7 Vim Editor and Basic Scripting 



Summary 

A shell script can be defined as series of commands written in a plain text file. The shell scripts are commonly used by the users to perform routine individual tasks and system administration.

Working with Vim Editor We have learned how to create a file using the cat command. The cat command although it allows us to create a file is not a good option to use when creating a shell script.

The Vim (Vi Improved) is a text editor written by Bram Moolenaar and first released publicly in 1991.

The Vim editor functions in three different modes namely, a command mode, an insert mode and a last line mode. 

We first need to issue an insert (i), append (a), or open (o) command to insert the text in the file. 

Press “i' and the editor will now be in the insert mode. Now type the contents as given in the box below. 

Choose the most appropriate option from those given below: 


(1) In how many modes Vim editor works? 

(a) One 

(b) Two 

(c) Three 

(d) Four 


(2) Which of the following statement is true for Gedit? 

(a) It is a Command line editor. 

(b) It is a Graphical editor. 

(c) It is not an editor.

(d) It is available with KDE Desktop environment. 


(3) :wq in Vim editor is used for which of the following activities? 

(a) To save file and remain in editing mode 

(b) To save file and quit editing mode 

(c) To quite editing mode without saving changes made in the file 

(d) All of the above 


(4) Which of following keys is not used to go into insert mode of the Vim editor? 

(a) o 

(b) i 

(c) a 

(d) cw 


(5) Which of the following keys are used to delete a line? 

(a) ce 

(b) ge 

(c) dd 

(d) d$ 


(6) Which of the following statements is used to search for phrase in the file? 

(a) set is 

(b) :help cmd 

(c) :!cmd 

(d) /phrase<ENTER>


(8) Which of the following character is used for commenting a line in a shell script? 

(a) * 

(b) % 

(c) $ 

(d) # 


(9) Which of the following symbol instructs a shell script to extract the value of a 

variable? 

(a) *  

(b) %

(c) $

(d) # 

 

ads2

Popular posts from this blog

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise or class wise.

1. Given the school result data, analyses the performance of the students on #different parameters, e.g subject wise  or class wise. Solution :-   # x-axis is shows the subject and y -axis # shows the markers in each subject # import pandas and matplotlib  import pandas as pd  import matplotlib.pyplot as plt # Simple Line Chart with setting of Label of X and Y axis, # title for chart line and color of line  subject = ['Physic','Chemistry','Mathematics', 'Biology','Computer'] marks =[80,75,70,78,82] # To draw line in red colour plt.plot(subject,marks,'r',marker ='*')     # To Write Title of the Line Chart plt.title('Marks Scored') # To Put Label At Y Axis plt.xlabel('SUBJECT')           # To Put Label At X Axis plt.ylabel('MARKS')             plt.show() Output :- 

Class 10th Chapter 7 Functions in Calc

   Functions in Calc Calc provide built-in standard functions for mathematical, logical, statistical, date and time, financial and other calculations on numbers and text. The process of inserting a function is similar for all functions.That is, to use a function we need to enter a correct spelling of the function along with necessary arguments. This is known as syntax of the functions. t is possible to loose the grip on it and easy to introduce errors. To avoid this, you may take help of function wizard. The Calc support some more functions that support logical decision making. These functions are AND, OR, and NOT. (1) In which of the following ways we can enter a function in Calc ? (a) Directly typing function name in a cell nan (b) Function wizard or selecting from tool bar (c) A and B both (d) Depends on functions (2) A function can start with which of the following options ? (a) '='sign (b) Alphabets (c) Numbers (d) Any of these (3) Which of the following is not a logical...

11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following:

    11. Write a Java program to input basic salary of an employee and calculate its Gross salary according to following: Basic Salary <= 10000 : HRA = 20%, DA = 80% Basic Salary <= 20000 : HRA = 25%, DA = 90% Basic Salary > 20000 : HRA = 30%, DA = 95% Static Solution :-  class salary {     public static void main(String args[])     {     double basic=20000.50,gross,da,hra;     if(basic <=10000)     {         da = basic * 0.8;         hra = basic *0.2;     }              else if(basic <=20000)     {         da = basic * 0.9;         hra = basic *0.25;     }     else     {         da = basic * 0.95; ...