31. How can you come out of the loop in this program?
#!/bin/bash
read x
while [ $x != "hello" ]
do
echo "Try to come out of the loop"
read x
done
echo "Welcome"
exit 0
#!/bin/bash
read x
while [ $x != "hello" ]
do
echo "Try to come out of the loop"
read x
done
echo "Welcome"
exit 0
32. Which statement skips over the rest of the loop body, causing the next cycle around the loop to begin immediately?
33. The macros specifies in source code are expanded by
34. In this program the semaphore
#include<stdio.h>
#include<pthread.h>
#include<semaphore.h>
sem_t st;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
pthread_exit("Bye");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) == -1)
perror("pthread_create");
if(sem_init(&st,1,2) != 0)
perror("sem_init");
if(pthread_join(pt,&res_t) == -1)
perror("pthread_join");
if(sem_destroy(&st) != 0)
perror("sem_destroy");
return 0;
}
#include<stdio.h>
#include<pthread.h>
#include<semaphore.h>
sem_t st;
void *fun_t(void *arg);
void *fun_t(void *arg)
{
pthread_exit("Bye");
}
int main()
{
pthread_t pt;
void *res_t;
if(pthread_create(&pt,NULL,fun_t,NULL) == -1)
perror("pthread_create");
if(sem_init(&st,1,2) != 0)
perror("sem_init");
if(pthread_join(pt,&res_t) == -1)
perror("pthread_join");
if(sem_destroy(&st) != 0)
perror("sem_destroy");
return 0;
}
35. In GDB hardware-dependent information about the floating point unit can be displayed by the command
36. Which is true regarding pipes?
37. Which option of gcc looks in the provided directory for library files?
38. The directory /media is the
39. What is the output of this program?
#!/bin/sh
demo_function() {
echo "Welcome to the Example"
printf "World of Linux\n"
}
unset -f demo_function
demo_function
exit 0
#!/bin/sh
demo_function() {
echo "Welcome to the Example"
printf "World of Linux\n"
}
unset -f demo_function
demo_function
exit 0
40. What is the output of this program?
#! /usr/bin/awk -f
BEGIN {
print index("examveda","linux")
}
#! /usr/bin/awk -f
BEGIN {
print index("examveda","linux")
}
Read More Section(Linux)
Each Section contains maximum 100 MCQs question on Linux. To get more questions visit other sections.