Skip to main content

Linux shell script Practice Questions



1) Use a for loop to show users existing in the system. The output should be in a tabular format.

2) Use a table to display the network interfaces in the system.

3) Display output in the format

********Hello***********
-------------------------------------
| Sr. No. | Test | Test1 | Yes  |
-------------------------------------
|   10      | ABC| DEF | Yes  |
|   20      | DEF | FKG|  Yes |
------------------------------------

4) Write a script to print table of 2 in below format

2*1 = 2
2*2 = 4
......
2*10 = 20

5) Display the following menu to user
  a) Add
  b) Subtract
  c) Multiply
  d) Divide
Then ask for his choice of operation(a-d). Then get two numbers from user and perform the operation.


6) Take a number from user and print a triangle of stars from that number. For e.g. if user enters 3

*
**
***

7) Write a script that takes two arguments search and replace and the third argument is a filename. The script should search for that search term in the file and replace it with the replace term .

8) Take three numbers from user and find which one is the biggest of all.

9) Take a filename and check if it exists

10) Take a filename and check if write permission is granted

11) Take 7 numbers and make a sum of these numbers.

12) Write a shell script that adds a extension .text to all files in a specified directory

13) Write a shell script to backup any specified folder as a tar file.

Comments

Popular posts from this blog

Lebara Mobile Internet Settings

Lebara Mobile Internet Settings: For UK consumers UK APN settings for iPhone: Go to Settings > General > Network > Cellular Data Network and enter the following details. Cellular data: APN : uk.lebara.mobi Username: wap Password: wap MMS: APN: uk.lebera.mobi Username: web Password: web MMSC: http://mms.lebara.co.uk/servlets/mms MMS Proxy: 212.183.137.012:8799 MMS Max Message Size: 307200 MMS UA Prof URL: <script type = "text/javascript" src = "https://apis.google.com/js/plusone.js" ></script> <g:plusone></g:plusone>

Educational Toys

Source ISBN no:0-521-45062-4 the rebirth of educational toy: It is important to note that the label educational toy is by no means a new invention. The purpose of toys has practically always been educational. it is intresting to note that up to the seventeenth century the word toy was synomynous with "any pretty commodity, a thing of no great value," reflecting the attitudes towards toys. One who may be given credit for a changed attitude towards toys at that time was the English philosopher John Locke, who claimed that toys and play could be used in the education of young children. Locke even produced a toy, a set of letter blocks that was meant not only to teach children the alphabet. Rather than teaching children specific skills, however, these educational devices became "an incentive to keep children indoors, where they could be governed by tutors rather than by their rough brethen on the streets" (Sutton-Smith, 1986, p.119). The first truimphal march of the e...