Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

#include <stdio.

h>
#include <string.h>

void ispisPrograma(void){
printf("\nProgrami koje mo�ete pokrenuti: \n");
system("find ./ -type f -perm -og+rx");
printf("\n");
}

void main(){
char command[50], naredba[20];

system("clear");

printf("Unesite program koji �elite pokrenuti. Da bi dobili ispis programa


koje mo�ete pokrenuti unesite \"ispis\". Za izlaz unesite \"izlaz\".\n");

do{
printf("Naredba: ");
fflush(stdin);
scanf("%s", &naredba);

if(strcmp(naredba, "ispis") == 0)
ispisPrograma();
else if(strcmp(naredba, "izlaz")){
sprintf(command, "exec ./%s", naredba);
system(command);
}
} while(strcmp(naredba, "izlaz"));
}

You might also like