Double Revolving field theory-how the rotor develops torque
ย
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.