Os PDF
Os PDF
PRACTICAL –9
Output:
daksh
daksh
daksh
Parul institute of Engineering & Technology
Subject Name: Operating System
Subject Code: 303105252
B.Tech (AI & AIDS) 4th Semester
Enrollment No :- 2303031240568
PRACTICAL – 8
Aim: Finding out biggest number from given three numbers supplied as
command line arguments.
Sample Code:
#!/bin/bash
echo "Enter the first number:"
read num1
echo "Enter the second number:"
read num2
echo "Enter the third number:"
read num3
if [[ $num1 -ge $num2 && $num1 -ge $num3 ]]
then
Output:
daksh
daksh
Parul institute of Engineering & Technology
Subject Name: Operating System
Subject Code: 303105252
B.Tech (AI & AIDS) 4th Semester
Enrollment No :- 2303031240568
PRACTICAL – 10
Output:
daksh
daksh
Parul institute of Engineering & Technology
Subject Name: Operating System
Subject Code: 303105252
B.Tech (AI & AIDS) 4th Semester
Enrollment No :- 2303031240568
PRACTICAL – 7
int main() {
printf("Simulating process creation.\n");
if (pid < 0) {
// Fork failed
perror("Fork failed");
return 1;
} else if (pid == 0) {
// Child process
printf("This is the child process.\n");
printf("Simulated Child Process ID: %d\n", getpid());
} else {
// Parent process
printf("This is the parent process.\n");
printf("Simulated Parent Process ID: %d\n", getpid());
printf("Simulated Child Process ID: %d\n", pid);
return 0;
}
Output:
Parul institute of Engineering & Technology
Subject Name: Operating System
Subject Code: 303105252
B.Tech (AI & AIDS) 4th Semester
Enrollment No :- 2303031240568
PRACTICAL – 6
Sample Code:
current_time=$(date +%H)
if [ $current_time -lt 12 ]; then
echo "Good morning!"
elif [ $current_time -lt 17 ]; then
echo "Good afternoon!"
else
echo "Good evening";
fi
Output:
daksh
daksh