JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD MCA 2022 LINUX PROGRAMMING Previous Question Paper (March/April - 2022 - R17)

MCA | 2022 | IV | R17 | March/April - 2022

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

Answer any five questions. All questions carry equal marks.

Main

115 marks
a

Write a shell script to find the factorial of a given number.

8 marks

Answer

To calculate the factorial of a number in a shell script, you can use a loop structure to multiply the sequence of integers from 1 to the input number.

#!/bin/bash
echo "Enter a number:"
read num
fact=1
if [ $num -lt 0 ]; then
  echo "Factorial does not exist for negative numbers."
else
  for (( i=1; i<=num; i++ ))
  do
    fact=$((fact * i))
  done
  echo "Factorial of $num is $fact"
fi
b

Explain about shell meta characters and shell variables.

7 marks

Answer

Shell Meta Characters are special characters that have a specific meaning to the shell, rather than being treated as literal text. They are used for pattern matching, redirection, and command control. Examples include:

  • *: Matches any string of characters.
  • ?: Matches any single character.
  • > and <: Used for input/output redirection.
  • |: Pipes the output of one command to the input of another.
  • ;: Separates multiple commands on a single line.

Shell Variables are used to store data within the shell environment. They are typically defined using the syntax VARIABLE_NAME=value. Variables can be local, existing only within the current shell, or environment variables, which are exported to child processes using the export command. To access the value stored in a variable, the $ prefix is used (e.g., echo $HOME). Variables are essential for script configuration, path management, and storing temporary results during execution.

215 marks
a

Explain about the control structures used in shell programming.

7 marks

Answer

Sign in to view the complete answer paper.

b

Write a shell program to concatenate two files.

8 marks

Answer

Sign in to view the complete answer paper.

315 marks
a

Write a Perl program to sort the list of element in an array.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the Unix file structure.

7 marks

Answer

Sign in to view the complete answer paper.

4

Explain the following system calls with complete syntax and examples: chmod, chown, link, symlink, getcwd.

15 marks

Answer

Sign in to view the complete answer paper.

515 marks
a

Explain about the reliable and unreliable signals.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the kernel support for process.

7 marks

Answer

Sign in to view the complete answer paper.

615 marks
a

Explain about the wait and waitpid system call.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the process control.

7 marks

Answer

Sign in to view the complete answer paper.

715 marks
a

What are pipes? Explain their limitations. Explain how pipes are created and used in IPC with an examples.

8 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the Unix kernel support for messages.

7 marks

Answer

Sign in to view the complete answer paper.

815 marks
a

Write client server program using TCP.

7 marks

Answer

Sign in to view the complete answer paper.

b

Explain about the Unix API for shared memory.

8 marks

Answer

Sign in to view the complete answer paper.

About this paper

This page contains the question paper of LINUX PROGRAMMING from JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY HYDERABAD for MCA 2022 IV, March/April - 2022, R17.

For the solved question paper with answers, switch to the Answer Paper tab.

Other papers in LINUX PROGRAMMING

Loading Question Papers

Fetching data from database...