Skip to content

Latest commit

 

History

History
62 lines (32 loc) · 2.79 KB

README.md

File metadata and controls

62 lines (32 loc) · 2.79 KB

UnixScripts

4th Semester - Codes for UNIX shell programming @ JMI, New Delhi

  1. WASS to implement a function mycd() using which you would be able to shuttle between directories. This function should work in the following manner: $mycd dir -> cd to directory dir $mycd - ->cd to previous directory

  2. WASS to implement 'wc' command without using the wc. The script can recieve the option l w c to indicate whether no. of lines/word/char from the user i/p are to be counted. The user may use all or any of the option. If wrong option return INVALID option.

  3. WASS to implement a simple Calculator(+,-,/,%,*) to demonstrate the concept of Functions in Shell script.

  4. WASS to add two numbers.

  5. WASS to output area and perimeter of a circle.

  6. WASS to accept two nos and print the largest of them.

  7. WASS to take two file names, check permission on both the files. If available copy contents of file 1 into file 2 else display error message.

  8. WASS to take a file name. Check its permission. If available append your name to the end of it.

  9. WASS to accept file name as input. If the i/p name is a file, add some data to the file, else if it is a directory create a file in that directory and add data to the file.

  10. WASS to convert Decimal to Binary, Octal & HexaDecimal using control statement.

  11. WASS to convert a given number from an user entered base to user entered another base.

  12. WASS to check for login status of username as i/p for 5 Minutes after an interval of 1 minute each.*******

  13. WASS to check whether the input year is a leap year or not.

  14. WASS to Calculate the factorial of a given number.

  15. WASS to Calculate sum of all digits of a number using while loop.

  16. WASS to check whether i/p number is a palindrome or not.

  17. WASS to accept a file name as input and delete all lines containing the word linux in it.

  18. WASS to change all the .c files to .cpp .

  19. WASS to identify all the 0 byte file in the current directory and delete them. The script should ask the user to before proceeding with the delete.

  20. WASS to implement a Calculator to demonstrate use of switch case in Shell scripting.

  21. WASS to convert Decimal to Binary without using ibase or obase.

  22. WASS to enter no. of filenames. If even no. entered, then copy contents of odd no. files into even no. files. Else display invalid i/p.

  23. WASS to cut n lines from a position m without using head and tail commands and show the cut lines as o/p.

  24. WASS that reports name and size of all files in a directory whose size is greater than 1000 bytes.

  25. WASS to print all prime nos. from n to m.

  26. WASS to recieve two filenames as input. It should check whether the file contents of the two files are same or not. If same, delete the second file.

Reference : WASS => Write a Shell Script.