JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2021 LINUX PROGRAMMING Previous Question Paper (July/August - 2021 - R17)

MCA | 2021 | IV | R17 | July/August - 2021

Answer PaperPaper Code: 844ABMaximum Marks: 75Time: 3 Hours

Answer any five questions

All questions carry equal marks

Main

1

Explain about shell variables and shell Meta characters with suitable examples.

15 marks

Answer

Shell variables are used to store data in the form of strings, which the shell can access and manipulate. They are categorized into environment variables (inherited by child processes) and local/shell variables (defined within the current shell session). Variables are assigned using the syntax variable_name=value and accessed using the $ prefix.

Example:

USER_NAME="Student"
echo "Hello, $USER_NAME"

Shell meta-characters are special characters that have a specific functional meaning to the shell, rather than being treated as literal text. They are used for pattern matching, redirection, and process control.

Key meta-characters include:

  • * (Asterisk): Matches any string of characters, including null. Example: ls *.txt lists all files ending in .txt.
  • ? (Question Mark): Matches any single character. Example: ls file?.txt matches file1.txt but not file10.txt.
  • [] (Square Brackets): Matches any one of the characters enclosed within the brackets. Example: ls [a-c]* lists files starting with a, b, or c.
  • ; (Semicolon): Used to execute multiple commands sequentially on a single line. Example: date; who.
  • & (Ampersand): Executes a command in the background. Example: ./script.sh &.
  • | (Pipe): Passes the output of one command as input to another. Example: ls | grep 'log'.
  • > and >> (Redirection): Used to redirect output to a file, where > overwrites and >> appends. Example: ls > filelist.txt.
  • \ (Backslash): Escapes the next character, treating it as a literal rather than a meta-character. Example: echo "Price is \$5" prints the dollar sign literally.
215 marks
a

Explain about Piping and I/O redirection operators in Bourne Shell.

8 marks

Answer

In the Bourne Shell, I/O redirection allows a user to change the standard input (stdin), standard output (stdout), or standard error (stderr) of a command. The primary operators include:

  • >: Redirects stdout to a file, overwriting existing content.
  • >>: Appends stdout to the end of a file.
  • <: Redirects stdin from a file.
  • 2>: Redirects stderr to a file.
  • >&: Redirects one file descriptor to another (e.g., 2>&1 redirects stderr to stdout).

Piping is represented by the | operator. It connects the standard output of one command directly to the standard input of another command. This allows for the creation of complex command chains where the output of a process is processed incrementally by subsequent commands without requiring intermediate temporary files.

b

Write a shell script to display the contents of a file without using in-built utilities.

7 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Give the syntax for open( ) and create( ) system calls and explain.

8 marks

Answer

Sign in to view the complete answer paper.

b

Describe the file descriptor and inode table entries with a neat diagram.

7 marks

Answer

Sign in to view the complete answer paper.

415 marks
a

Explain any two directory related system calls with neat syntax and example.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write about hashes and references in Perl.

7 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

How does a fork( ) system call differs from an exec( ) system call? Explain.

8 marks

Answer

Sign in to view the complete answer paper.

b

Write a program that illustrates the concept of zombie process.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Illustrate the concept of kill( ) and raise( ) system calls.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the primary features of reliable functions with an illustrative example program.

8 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What are the security problems associated with system V IPC mechanisms?

7 marks

Answer

Sign in to view the complete answer paper.

b

What are the limitations of pipes? List the benefits of FIFOs compared to pipes.

8 marks

Answer

Sign in to view the complete answer paper.

8

Describe all the elementary socket functions required to write a complete TCP client and server application.

15 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the solved question paper with answers of LINUX PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for MCA 2021 IV, July/August - 2021, R17.

For the question paper without answers, switch to the Question Paper tab.

Other papers in LINUX PROGRAMMING

Loading Question Papers

Fetching data from database...