This action might not be possible to undo. Are you sure you want to continue?
No. 1 2 3 4 5 6 7 8 9 10 11 12
Write a shell script to print the users logged in, the current date and the calendar for the year 2010. Write a shell script to check the present working directory, then make a directory on that location, then create 3 files in it and give executable permissions to them. Write a shell script to take input for name, course and university and print it in the format – I [name] study in [course] from [university]. Write a shell script which creates one hard link and two soft links of a file. Write a shell script that accepts two filenames and your script should copy file1 to file2 and display both the files. (take input from keyboard and command line both). Write a shell script that accepts four filenames f1, f2, f3 and f4 and display them in the order f3, f1, f4 and f2. ( take input from keyboard and command line both). Write a shell script that accepts input as 1, 2, 3, 4, and 5 and display in the order 5, 3, 4, 2, 1. Write a shell script that should accept the output of the current date and print the output in the form – 2009 Oct Tue. Write a shell script that will display the files of the current directory and number of files through positional arguments. Write a shell script using if, copy source to target, if it copies then echo copy process successful else echo unable to copy. Write a shell script that will accept a number and then check if number is less than 10. Display the results accordingly. In a company, an employee is paid as under: If Basic Salary<1500, then hra=10% of basic and da=90%
Page No. 01 03 05 06 08 10 12 13 14 15 16 17
then hra=500. If it is there then append the file. If above 75 then Distinction. If it is there then display the file. If %age is 40-50 then Third Division. Write a shell script which displays the result of student as follows: If %age is less then 40 then FAIL. Make a menu driven shell script with Option 1: Creates a dir d1/d2/d3 where all dir doesn’t exist. (take input from keyboard and command line both). Option 3: Check execute permission. If the employee’s basic salary is entered through the keyboard. Write a shell script where distance between two cities is entered from keyboard in kms and then print that distance in meters and cms. if not then give the write permission. da=98% of Basic. If Basic Salary>=1500. Option 3: Check all the users who have logged in. if not then give the read permission. if not then say it is a text file. If age is 10-18 then allowed to swim in junior pool. Write a shell script that perform all the mathematical operations on two numbers. If it is there then display the file.13 14 15 16 17 18 19 20 21 of Basic. Option 2: Display some file f4 in the current dir. then write a shell script to find the employee’s gross salary. 18 19 21 22 24 25 26 27 29 22 31 . Write a shell script which accepts the age of a person and checks: If age is less than 10 yrs then is not allowed. Write a shell script which calculate sum of digits of a fivedigit number and also checks whether the number is a palindrome or not. If age >18 then senior pool. Make a menu driven shell script with Option 1: Check read permission. Write a shell script that accepts a year and check whether it is a leap year or not. Write a shell script and check whether the number is even or odd. If %age is 50-60 then Second Division. If %age is 60-575 then First Division. Write a shell script which calculate area and perimeter of a rectangle when length and breadth are entered into through keyboard and through command line. Option 2: Check write permission.
then append the file after checking the permissions. Check the string and display: a) If it is MON display Unix test. then echo your name else echo error message. Take the number inside the script. If number of arguments is equal to 5 then only it should displays your name five times (You can try this. If it is THUR | thur display Maths test. Suppose: the current directory named UNIX contains the file unix01doc then it should be renamed to unix01txt. If it is THUR display Maths test. after each minute? If user has logged in display the message and exit otherwise display a message “ Not logged in Yet” (i.c 33 35 36 37 38 27 28 39 41 29 42 30 43 31 44 . rename those files to . If it is WED display System Programming test. If it is TUE display Computer Organization test. ie. Write a shell script which scans your current directory and the files which end with . Write a shell script which accepts number of arguments.e. Write a shell script to check the count of total number of arguments entered if number of arguments is less than or equal to 5. If it is a dir. Through positional parameter.23 24 25 26 Write a shell script t check whether a file entered from command line is an ordinary file or directory. b) If it is MON | mon display Unix test. If it is a file.txt. by displaying your name once)? Write a shell script to search whether the username passed on command line has logged in or not. Write table of 2. create a file. then exit. then exit. and 5 through two ways: 1 . If it is TUE | tue display Computer Organization test. then check the required permissions and create a dir in it. invalid number of arguments. 2 .doc. Write a shell script that uses for loop to display the names of files in the current directory which are only directory files. The process will go in background). similarly for all the files of that directory? Write a shell script that scans the current directory (or any path ) and the files ending with doc are to be moved to a new directory name “word assignment” and the file ending with . If it is FRI display Aptitude test. first. (Use while loop) Write a shell script where day(In Capitals) is entered in the command line. and in that sub-dir. If it is FRI | fri display Aptitude test. If it is WED | wed display System Programming test.
permissions. a2. Check ls – li and again check the inode no. Write a shell script where you check whether the name a . Enter 4-5 lines in it. consonant or a digit? Write a shell script that computes the factorial of a given number. Note down the inode no. Write a shell script that display the prime numbers till the number passed through command line. i. Create 2 hard links of f1 as f2 and f3.e. Add .. permissions. Create 2 more hard links of a1. no. f4 and f5. 45 46 47 48 49 50 52 53 54 40 Write a shell script that will create 84 users along with their passwords. Display f1. Q2 Create a file a1.e. size. a3. Write a shell script that scans the current directory & renames all the files to filename. Display a1..e. Process ID of the current shell. pattern found/ pattern not found. Delete f3. Check ls –l. (a) Write a shell script that accepts a student database file. b . begins with ‘S’ and ends with ‘T’. a2 and a3. begins with ‘A’ and ends with ‘t’. of links.e. i. Delete from f2 and check the contents of f1 and f2.32 33 34 35 36 37 38 39 (its dot c) are to be moved to a new directory named “c assignments”? Write a shell script that scans the current directory & renames all the regular files & not the directory files to the name of the log name i. any word with fixed length of four characters. Check ls –l.pid. This input file has format as follows: Student Enrollment No: Student Name: Course Cut the name column and course column and display the output in the sorted order of name and course. This input file has format as follows: Student Enrollment No: Student Name: Course Cut the name column and display the names in the sorted list... Delete f5. c .e. 55 Unix Lab questions: Q1 Create a file f1. Check ls –l. Write a shell script where you can accept a word and echo the message whether the name begins with a vowel. i. Check ls –li. links and size. Check ls –l. Create two more hard links of f1. Add contents in f3 and display f1 and f3. filename. student” ? Write a shell script that takes pattern and filename as command line arguments and displays the result appropriately i. b) Write a shell script that accepts a student database file.
no. Execute who command. links. etc. course and then display all your information in the given format: I am ____. permissions. Q7 Pick up lines 3 to 7 from a1 and append in z1. Check contents. Q2 Cursor position is at second line. Date command related questions: Q1 Display date in the format Year Month Day Q2 Display date in the following format: Complete weekday. Check size. Display z1. / week number of the year. inode no.. Check the size of a1.g. Assign values to them.4. a3. a3. names of 3 subjects and marks obtained. Shell scripts: Q1 Write a shell script which asks your name. Check contents. Q 1) Explain the following commands with the output and example: (a) comm . size. size. e. Q3 Write a shell script that declares 5 variables. permissions. My age is ____. permissions. Q8 Create a new file using vi. age. : minutes and : seconds in 24 hour clock. of links. a2. Go to line 3. Output must be displayed after third line.2. read contents of a1 into it. Change the permissions of a3. Check ls –l. Display the information in the format you want. Display a1. a2=15.contents in a3. Q2 Write a Shell Sript which asks your enrollment number. Q4 Pick up lines 2 to 5 from a1 and create a file z1. inode number again. a3.3 Questions related to vi Editor: Q1 Open the contents of file a1 in file f1 after third line. inode no. go temporarily to the shell and execute date command and then again come back to vi editor. Delete the contents of a2. a2. and then display the values in the given order: 1. a1=20. Give output of ls command of current directory. Delete f3. Q5 Pick up lines 2 to 9 from a1 and append in file z1. full month name. of a1. which is the day of the month. Q3 Go to 5th line.5. studying in ____ belongs to ____ department. a2. : hours. links. Q6 Open f1. department.
Create the files. Perform the followings.(b) diff (c) sort (d) uniq (e) cut (f) tee (g) head (h) tail (i) pg (j) more 3. / | usr | MCA5 ------------------------------|-----------------------| | MCA5A MCA5B | | -------------------------------------------------------| | | | | | file1 file2 d1 d2 d51 d52 | | | d11 --------------------------------| | | | | | d12 f3 f4 f5 d511 d512 | | d13 ----------------| | | d14 f511 f512 | ----------------| | f33 f44 *the items starting with f are files a) Create the directory structure. Show the output of "pwd" command at each step of directory .
Your current directory is MCA5B. b) Write absolute and relative path of the files f11 and f512. c) Copy the file f33 to d52. Move the files "file1" and "file2" to D511 Move file "f44" to d512 d) delete the file "f33" from d14 remove directory d2 remove directory d1 e) appen the coontents of "f512" with the contents of "f33" remove directory 511 append "file1" with the contents of files "f44".creation."f512" and "f513" f) remove the directory d51 using a single command .
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.