51. What is the output of this program?
#!/bin/bash
echo "Which file do you want to check"
read x
until [ -e $x ]
do
echo "The file does not exist. Do you want to create? y/n"
read a
if [ $a = y ]; then
touch $x
echo "Your file has been created successfully."
fi
done
echo "The file is present in this directory"
exit 0
#!/bin/bash
echo "Which file do you want to check"
read x
until [ -e $x ]
do
echo "The file does not exist. Do you want to create? y/n"
read a
if [ $a = y ]; then
touch $x
echo "Your file has been created successfully."
fi
done
echo "The file is present in this directory"
exit 0
52. In this program the allocated memory block can store
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = malloc(10);
return 0;
}
#include<stdio.h>
#include<stdlib.h>
int main()
{
int *ptr;
ptr = malloc(10);
return 0;
}
53. Indicate the right option to search for BOB, Bob, BOb or BoB?
54. What is the output of this program?
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
int main()
{
sem_t* sem_id;
sem_id = sem_open("sem_value",O_CREAT,0666,0);
if(sem_id == SEM_FAILED)
perror("sem_open");
if(sem_close(sem_id) == -1)
perror("sem_close");
sem_wait(sem_id);
printf("Example\n");
return 0;
}
#include<stdio.h>
#include<fcntl.h>
#include<sys/stat.h>
#include<semaphore.h>
int main()
{
sem_t* sem_id;
sem_id = sem_open("sem_value",O_CREAT,0666,0);
if(sem_id == SEM_FAILED)
perror("sem_open");
if(sem_close(sem_id) == -1)
perror("sem_close");
sem_wait(sem_id);
printf("Example\n");
return 0;
}
55. If a and b are 2 variables then the meaning of a<<=b is
56. Which is Fastest IPC?
57. What is the output of this program?
#include<stdio.h>
int main()
{
fork();
printf("Example\n");
return 0;
}
#include<stdio.h>
int main()
{
fork();
printf("Example\n");
return 0;
}
58. What UNIX command is used to update the modification time of a file?
59. The print and printf statements can be told to send their output to other place except standard output, is called
60. Which file is used primarily for diagnosing memory fragmentation issues ?
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.