SCRIPT TO CHECK THE ENVRIRONMENT VARIABLE
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/wait.h>
#include<sys/types.h>
main()
{
char x[10],*y,ans;
do{
printf("enter the evironment variable \n");
scanf("%s",x);
y=getenv(x);
if(y!=NULL)
printf("%s is a valid envi var\n",x);
else
printf("%s is a invalid envi var\n",x);
printf("do you want to continue (y/n)...?");
getchar();
ans=getchar();
}while(ans!='n');
exit(0);
}
#include<stdio.h>
#include<unistd.h>
#include<stdlib.h>
#include<sys/wait.h>
#include<sys/types.h>
main()
{
char x[10],*y,ans;
do{
printf("enter the evironment variable \n");
scanf("%s",x);
y=getenv(x);
if(y!=NULL)
printf("%s is a valid envi var\n",x);
else
printf("%s is a invalid envi var\n",x);
printf("do you want to continue (y/n)...?");
getchar();
ans=getchar();
}while(ans!='n');
exit(0);
}