Breaking News

BCA Paper - UNIX and Shell Programming (Set-1)

 UNIX and Shell Programming

Q1: Explain UNIX architecture and its salient features. Distinguish between INTERNAL and EXTERNAL commands.

Q2: Explain with examples different types of files supported in UNIX.

BCA Paper - UNIX and Shell Programming (Set-1)Q3: What is the output of the following commands:
   i.  echo $PATH
  ii.  ls -l/wc -l
 iii.  type mkdir; mkdir new;
  iv.  who > userlist

Q4: Explain man command with its option.

Q5: Explain briefly the file attributed listed using ls -l command

Q6: Explain with suitable example how and who can change file permission.

Q7: Explain different modes in vi editor and list commands in each mode.

Q8: How to do the following using vi editor:
  1. Combine 5 lines in to single line
  2. Move the cursor to last line in a file
  3. Replace 'has' with 'have' in the current line
  4. Add /* at the beginning of line and */ at the end of the line.
Q9:  Explain the mechanism of a process creation and role of system calls.

Q10: Explain the following commands with suitable example and list its options:
  1. ps
  2. kill
Q11: Define job. How is job control done in UNIX? Explain with example.

Q12: What are environment variables that control UNIX system? Explain any three such variables.

Q13: Explain with example find command and its options.

Q14: Write a note on sort command. Discuss its options with examples.

Q15: Explain the following commands:
  1. ls -l | grep "^d" > directories
  2. grep -v "USA" news.txt | wc -l
  3. sed '10,$ s/loop/ loop with in loop/g' <loop.txt> moreloops
  4. grep "$SHELL$" /etc/passwd | cut -d ":" f1
  5. grep a b c > found.txt
Q16: What is sed? Explain with example line addressing and context addressing in sed.

Q17:  What is shell programming? Write a shell script to create a menu which displays the list of files, current users, contents of a particular file and process status of the system based on the user choice.

Q18: Explain the expr command applicable to numeric and string functions.

Q19: Explain the following with reference to shell programming:
  1. $?
  2. test
  3. shift
  4. trap
Q20: Write a shell script to display list of all processes running in the system every 30 seconds for five times using a
  • while loop
  • for loop
Q21: Write a note on awk. Explain built-in variables.

Q22: Write an awk sequence to find the DA, HRA and gross pay of employees. DA at 50% of basic, HRA at 25% of basic and the gross pay is sum of basic pay, DA and HRA. Also compute the average gross pay.

Q23: Explain with example the following built in functions:
  1. split( )
  2. substr( )
  3. length( )
  4. index( )
Q24: Explain the following in PERL program:
  1. $_default variable
  2. foreach loop construct
  3. join( )
Q25: Write a PERL program that accepts decimal number as arguments and convert it into binary number.

Q26: Using command line arguments, write a PERL program to find whether the given year is leap year.