SlideShare a Scribd company logo
Shell Programming Assignment – 2
1. Write a Shell Scriptto findthe reverse of agivennumberUsingWC.
2. Write a Shell Scriptto generate Fibonacci Series.
3. Write a Shell Scriptto displayMathematical Table foragivennumber.
4. Write a Shell Scriptto copy the contentof a file toanotherfile.
5. Write a Shell Scriptto countthe numberof Vowels,Numberof ConsonantsandNumberof digitspresentina
givenString.
6. Write a Shell Scriptto acceptfile name andconvertitscontentsfromlowercase to uppercase.
7. Write a shell scriptthatwill receive a name interactively from the user during execution and prints a welcome
message.(Say Hello <entered name>.Welcome to CSE Dept., Kalyani Govt. Engg. College !).
8. Write a shell script that will receive a name interactively from the user during execution and prints greetings
accordingto the systemtime.(Example:say user enters “Anirban” and if the system is less than 12.00 AMthen
the script will print:“Good MorningAnirban” else if the systemtime isgreater than 12.00 AMbut less than 6.00
PMthenprints“Good AfterNoonAnirban”else if the systemtime isgreater than 6.00 PMbut less than 8.00 PM
then“Good EveningAnirban”else if the systemtime isgreater than 8.00 PMbut less than 12.00 PMthen “Good
Night Anirban”).
9. Write a shell script that will receive a text filename(which contents a paragraph) interactively from the user
duringexecutionandprints the followingaccordingtothe numberof wordspresentinthe file:SHORTFILE(if the
numberof words is less than 100), MEDIUMFILE(if the number of words is greater than 100 but less than 350) ,
LARGE FILE( words greater than 350 but less than 500) and VERY LARGE FILE(words greater than 500).
10. Write a shell script that will receive a text filename as input and prints OFFICIAL FILE if the first line of the file
containsthe string“KGEC” onlyelse printsUNOFFICIALFILE.If the file is an OFFICIAL FILE then the program will
printsnumberof wordsand characters presentinthe first10 lines,italsoappendsstring“Accessedon:<current
date-time stamp>” at the end of the file.
11. Write a shell script(check_exam.sh) thatwill use afile “exam_schedule.txt”tocheckwhetherthere is any exam
today or not. If there is no exam today then it will print: NO EXAMTODAY. The file “exam_schedule.txt” must
contain three fields as EXAMDATE, EXAMTIME and EXAMPAPER. For example:
3/2/2014 10.00AM OPTICAL_NETWORK
4/2/2014 10.00AM IMAGE_PROCESSING
……… ……….. ……………..
12. Write a shell scriptthatwill take the basicsalary(BS) as runtime inputfromthe userand calculatesthe DA (5% if
BS is less than or equal to 10,000, above 10,000 it becomes 15%), HRA(5% if BS is less than or equal to 10,000,
above 10,000 it becomes 7%) and finally calculates the gross salary(gross salary=BS+DA+HRA).
13. Write a shell script to display the following menu:
i. Length of the string
ii. Reverse of the string
iii. Copy one string to another.
14. Write a shell scripttocheckwhether agivennumberisprime ornot.
15. Write a shell scriptto check whetheragivennumberisanArmstrongnumberor not.[ An Armstrong number ofthree
digits is aninteger suchthatthesumofthecubes ofits digits is equalto the numberitself. Forexample,371is anArmstrong number. ]
16. Write a shell scriptto find the sumof the firstn numbers.
17. Write a shell scriptto findasum of givennoandto check outto see if it isevenor odd.
18. Write a shell scriptto findafactorial of a givennumber.
19. Write a shell scriptthattakes2 numbersthroughK/Band findsthe value of firstnumberraisedtothe powerof
second.
20. Write a shell scriptto reada stringthrough keyboardandcheckwhetheritispalindrome ornot.

More Related Content

PPT
Functional Testing Swing Applications with Frankenstein
vivek_prahlad
 
PDF
Office 365 Licenses Report
Paulo Paim
 
DOCX
Asynchronous reading and writing http r equest
Pragyanshis Patnaik
 
PPTX
Learn SELENIUM at ASIT
ASIT
 
PPTX
Introduction to Powershell Version 5
Nishtha Kesarwani
 
DOCX
What is selenium
Pesara Swamy
 
PPTX
Top 5 features added to Java 9
Ankur Srivastava
 
PDF
Test Automation Using Python | Edureka
Edureka!
 
Functional Testing Swing Applications with Frankenstein
vivek_prahlad
 
Office 365 Licenses Report
Paulo Paim
 
Asynchronous reading and writing http r equest
Pragyanshis Patnaik
 
Learn SELENIUM at ASIT
ASIT
 
Introduction to Powershell Version 5
Nishtha Kesarwani
 
What is selenium
Pesara Swamy
 
Top 5 features added to Java 9
Ankur Srivastava
 
Test Automation Using Python | Edureka
Edureka!
 

Similar to Shell programming assignment 2 (20)

PDF
Solution manual of shell programming assignment 2
Kuntal Bhowmick
 
DOCX
The Korn Shell is the UNIX shell (command execution program, often c.docx
SUBHI7
 
DOCX
Student NameClassDateVBScript IP File ReportIn the space provide.docx
emelyvalg9
 
PPTX
Shell Scripting and Programming.pptx
Harsha Patil
 
PPTX
Shell Scripting and Programming.pptx
Harsha Patil
 
DOCX
BACKGROUND A shell provides a command-line interface for users. I.docx
wilcockiris
 
PPTX
Some more Concepts of DOT cvcvcvNET.pptx
zmulani8
 
DOCX
"PHP from soup to nuts" -- lab exercises
rICh morrow
 
TXT
microsoft help
hambali_nurmi
 
PDF
Code That Writes Code : Automatic Programming for NHibernate
Deepak Sahu
 
PPSX
Flex 4.5 jeyasekar
jeya soft
 
PDF
Shell tutorial
Vu Duy Tu
 
DOCX
CSCI  132  Practical  Unix  and  Programming   .docx
mydrynan
 
PPT
Less02 2 e_testermodule_1
Suresh Mishra
 
PDF
Assignment1 B 0
Mahmoud
 
PDF
Java lab1 manual
nahalomar
 
DOC
Typical Architecture Of Automation Frameworks
Yogindernath Gupta
 
PPT
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
raj.kamal13
 
PDF
Lab Evaluation OSL.pdf
SadamunAhemedBiplob2
 
PDF
(1) c sharp introduction_basics_dot_net
Nico Ludwig
 
Solution manual of shell programming assignment 2
Kuntal Bhowmick
 
The Korn Shell is the UNIX shell (command execution program, often c.docx
SUBHI7
 
Student NameClassDateVBScript IP File ReportIn the space provide.docx
emelyvalg9
 
Shell Scripting and Programming.pptx
Harsha Patil
 
Shell Scripting and Programming.pptx
Harsha Patil
 
BACKGROUND A shell provides a command-line interface for users. I.docx
wilcockiris
 
Some more Concepts of DOT cvcvcvNET.pptx
zmulani8
 
"PHP from soup to nuts" -- lab exercises
rICh morrow
 
microsoft help
hambali_nurmi
 
Code That Writes Code : Automatic Programming for NHibernate
Deepak Sahu
 
Flex 4.5 jeyasekar
jeya soft
 
Shell tutorial
Vu Duy Tu
 
CSCI  132  Practical  Unix  and  Programming   .docx
mydrynan
 
Less02 2 e_testermodule_1
Suresh Mishra
 
Assignment1 B 0
Mahmoud
 
Java lab1 manual
nahalomar
 
Typical Architecture Of Automation Frameworks
Yogindernath Gupta
 
Advanced Rational Robot A Tribute (http://www.geektester.blogspot.com)
raj.kamal13
 
Lab Evaluation OSL.pdf
SadamunAhemedBiplob2
 
(1) c sharp introduction_basics_dot_net
Nico Ludwig
 
Ad

More from Kuntal Bhowmick (20)

PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 6 -- inh...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- bas...
Kuntal Bhowmick
 
PDF
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Kuntal Bhowmick
 
PDF
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Kuntal Bhowmick
 
PPT
1. introduction to E-commerce
Kuntal Bhowmick
 
DOCX
Computer graphics question for exam solved
Kuntal Bhowmick
 
PDF
DBMS and Rdbms fundamental concepts
Kuntal Bhowmick
 
PDF
Java questions for interview
Kuntal Bhowmick
 
PDF
Java Interview Questions
Kuntal Bhowmick
 
PDF
Operating system Interview Questions
Kuntal Bhowmick
 
PDF
Computer Network Interview Questions
Kuntal Bhowmick
 
PDF
C interview questions
Kuntal Bhowmick
 
PDF
C question
Kuntal Bhowmick
 
PDF
Distributed operating systems cs704 a class test
Kuntal Bhowmick
 
DOCX
Cs291 assignment solution
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 8 -- int...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 7 -- abs...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 6 -- inh...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 5 -- mem...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 4 -- loops
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 3 -- cla...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 2 -- bas...
Kuntal Bhowmick
 
Multiple Choice Questions on JAVA (object oriented programming) bank 1 -- int...
Kuntal Bhowmick
 
Hashing notes data structures (HASHING AND HASH FUNCTIONS)
Kuntal Bhowmick
 
1. introduction to E-commerce
Kuntal Bhowmick
 
Computer graphics question for exam solved
Kuntal Bhowmick
 
DBMS and Rdbms fundamental concepts
Kuntal Bhowmick
 
Java questions for interview
Kuntal Bhowmick
 
Java Interview Questions
Kuntal Bhowmick
 
Operating system Interview Questions
Kuntal Bhowmick
 
Computer Network Interview Questions
Kuntal Bhowmick
 
C interview questions
Kuntal Bhowmick
 
C question
Kuntal Bhowmick
 
Distributed operating systems cs704 a class test
Kuntal Bhowmick
 
Cs291 assignment solution
Kuntal Bhowmick
 
Ad

Recently uploaded (20)

PDF
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
PDF
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
PDF
Software Testing Tools - names and explanation
shruti533256
 
PDF
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
PPT
Ppt for engineering students application on field effect
lakshmi.ec
 
PPTX
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
PPT
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
PDF
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
PPT
SCOPE_~1- technology of green house and poyhouse
bala464780
 
PPT
Lecture in network security and mobile computing
AbdullahOmar704132
 
PPTX
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
PDF
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
PDF
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
PPTX
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
PDF
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
PPTX
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
PPTX
unit 3a.pptx material management. Chapter of operational management
atisht0104
 
PDF
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
PPTX
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
PDF
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 
2010_Book_EnvironmentalBioengineering (1).pdf
EmilianoRodriguezTll
 
flutter Launcher Icons, Splash Screens & Fonts
Ahmed Mohamed
 
Software Testing Tools - names and explanation
shruti533256
 
LEAP-1B presedntation xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hatem173148
 
Ppt for engineering students application on field effect
lakshmi.ec
 
Victory Precisions_Supplier Profile.pptx
victoryprecisions199
 
1. SYSTEMS, ROLES, AND DEVELOPMENT METHODOLOGIES.ppt
zilow058
 
Cryptography and Information :Security Fundamentals
Dr. Madhuri Jawale
 
SCOPE_~1- technology of green house and poyhouse
bala464780
 
Lecture in network security and mobile computing
AbdullahOmar704132
 
Chapter_Seven_Construction_Reliability_Elective_III_Msc CM
SubashKumarBhattarai
 
Top 10 read articles In Managing Information Technology.pdf
IJMIT JOURNAL
 
FLEX-LNG-Company-Presentation-Nov-2017.pdf
jbloggzs
 
EE3303-EM-I 25.7.25 electrical machines.pptx
Nagen87
 
Unit I Part II.pdf : Security Fundamentals
Dr. Madhuri Jawale
 
MSME 4.0 Template idea hackathon pdf to understand
alaudeenaarish
 
unit 3a.pptx material management. Chapter of operational management
atisht0104
 
Activated Carbon for Water and Wastewater Treatment_ Integration of Adsorptio...
EmilianoRodriguezTll
 
Module2 Data Base Design- ER and NF.pptx
gomathisankariv2
 
top-5-use-cases-for-splunk-security-analytics.pdf
yaghutialireza
 

Shell programming assignment 2

  • 1. Shell Programming Assignment – 2 1. Write a Shell Scriptto findthe reverse of agivennumberUsingWC. 2. Write a Shell Scriptto generate Fibonacci Series. 3. Write a Shell Scriptto displayMathematical Table foragivennumber. 4. Write a Shell Scriptto copy the contentof a file toanotherfile. 5. Write a Shell Scriptto countthe numberof Vowels,Numberof ConsonantsandNumberof digitspresentina givenString. 6. Write a Shell Scriptto acceptfile name andconvertitscontentsfromlowercase to uppercase. 7. Write a shell scriptthatwill receive a name interactively from the user during execution and prints a welcome message.(Say Hello <entered name>.Welcome to CSE Dept., Kalyani Govt. Engg. College !). 8. Write a shell script that will receive a name interactively from the user during execution and prints greetings accordingto the systemtime.(Example:say user enters “Anirban” and if the system is less than 12.00 AMthen the script will print:“Good MorningAnirban” else if the systemtime isgreater than 12.00 AMbut less than 6.00 PMthenprints“Good AfterNoonAnirban”else if the systemtime isgreater than 6.00 PMbut less than 8.00 PM then“Good EveningAnirban”else if the systemtime isgreater than 8.00 PMbut less than 12.00 PMthen “Good Night Anirban”). 9. Write a shell script that will receive a text filename(which contents a paragraph) interactively from the user duringexecutionandprints the followingaccordingtothe numberof wordspresentinthe file:SHORTFILE(if the numberof words is less than 100), MEDIUMFILE(if the number of words is greater than 100 but less than 350) , LARGE FILE( words greater than 350 but less than 500) and VERY LARGE FILE(words greater than 500). 10. Write a shell script that will receive a text filename as input and prints OFFICIAL FILE if the first line of the file containsthe string“KGEC” onlyelse printsUNOFFICIALFILE.If the file is an OFFICIAL FILE then the program will printsnumberof wordsand characters presentinthe first10 lines,italsoappendsstring“Accessedon:<current date-time stamp>” at the end of the file. 11. Write a shell script(check_exam.sh) thatwill use afile “exam_schedule.txt”tocheckwhetherthere is any exam today or not. If there is no exam today then it will print: NO EXAMTODAY. The file “exam_schedule.txt” must contain three fields as EXAMDATE, EXAMTIME and EXAMPAPER. For example: 3/2/2014 10.00AM OPTICAL_NETWORK 4/2/2014 10.00AM IMAGE_PROCESSING ……… ……….. …………….. 12. Write a shell scriptthatwill take the basicsalary(BS) as runtime inputfromthe userand calculatesthe DA (5% if BS is less than or equal to 10,000, above 10,000 it becomes 15%), HRA(5% if BS is less than or equal to 10,000, above 10,000 it becomes 7%) and finally calculates the gross salary(gross salary=BS+DA+HRA). 13. Write a shell script to display the following menu: i. Length of the string ii. Reverse of the string iii. Copy one string to another. 14. Write a shell scripttocheckwhether agivennumberisprime ornot. 15. Write a shell scriptto check whetheragivennumberisanArmstrongnumberor not.[ An Armstrong number ofthree digits is aninteger suchthatthesumofthecubes ofits digits is equalto the numberitself. Forexample,371is anArmstrong number. ] 16. Write a shell scriptto find the sumof the firstn numbers. 17. Write a shell scriptto findasum of givennoandto check outto see if it isevenor odd. 18. Write a shell scriptto findafactorial of a givennumber. 19. Write a shell scriptthattakes2 numbersthroughK/Band findsthe value of firstnumberraisedtothe powerof second. 20. Write a shell scriptto reada stringthrough keyboardandcheckwhetheritispalindrome ornot.