Skip to content

Nithishreddyyyy/3rdsemUnixLab

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Unix Programming Lab

This repository contains solutions for the Unix Programming Lab exercises, categorized into Part A (Shell Scripting) and Part B (C/C++ Programming).

Repository Structure

3rdsemUnixLab/
│-- Part A/   # Shell Scripts
│-- Part B/   # C/C++ Programs
│-- README.md

Unit I: Part A - Shell Scripting

  1. Student Database Management: Create and display student details with department-wise frequency.
  2. File Comparison & Deletion: Remove the second file if its contents match the first.
  3. File Type Checker: Identify if the argument is a file, directory, or something else.
  4. Convert Files to Uppercase: Convert the content of given files to uppercase.
  5. Compare File Permissions: Check if two files have identical permissions.
  6. String Operations:
    • Find length of a string
    • Check if a string is NULL
    • Compare two strings
  7. Reverse Command Line Arguments: Print arguments in reverse order.
  8. Reverse a Number: Print the reverse of a given number.
  9. Fibonacci Series: Print the first 25 Fibonacci numbers.
  10. Prime Numbers in a Range: Print prime numbers between a given range.
  11. Linear Search: Search for an element in an array using linear search.
  12. Find Largest of Three Numbers: Use a function to determine the largest number.

Unit I: Part B - C/C++ Programs

  1. Implement UNIX Commands (ln, mv, rm) using APIs.
  2. File Handling:
    • Display file contents
    • Copy contents of one file to another
  3. Read Every 100th Byte: Read and print every 100th byte from a file.
  4. File Information Display: Show file type and Inode details.
  5. Process Creation:
    • Using fork() and vfork()
    • Demonstrate Zombie process & avoid it
    • Create an Orphan process
  6. Parent Process Handling: Use wait() to catch a child’s exit code.
  7. Race Condition Demonstration.
  8. UNIX System API Implementation.
  9. Signal Handling:
    • Catch, ignore, and accept SIGINT.
  10. Inter-Process Communication:
    • Create, write, and read from a pipe
    • Create a parent-child pipe communication

How to Use

  1. Run Shell Scripts:
    sh 1.sh
  2. Compile and Run C Programs:
    cc program.c
    ./a.out

Maintained by: Nithish Reddy

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published