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>

how to access articles on Business Source primer

Go to library site > Click on e-resources > Click on “B” > Click on “Business Source Primer” Over there three boxes are there. Enter the text you want to search for in the search box. There are two optional boxes. You can use and/ or comination for searching the context you are searching for. Then click on search. ------Shortlist the words you want to add. Click on the “add to folder” link besides the article link if you like the aricle. All the links where you click the “Add to folder” will be added to a folder. Over there you have an option for mailing the collected articles. These articles will be mailed to you as an attachment if they are available. There will be a box to enter the details . Enter Email id: Enter subject: Checkbox to remove all articles from folder after you have sent them. Sned button and cancel button ------------------------- If the session times out then the items in the folder are cleared