Skip to content
Snippets Groups Projects
Commit 6204d9ea authored by Eduardo Machado's avatar Eduardo Machado
Browse files

duplicado

parent 649a779c
No related branches found
No related tags found
No related merge requests found
/* Programa criado apenas para fazer testes da biblioteca miniShell */
#include "miniShell.cpp"
int main(int argc, char const *argv[]) {
char *buff, *currentPath;
long size;
string command, parameter;
while(1){
/* Escreve onde você está. */
size = pathconf(".", _PC_PATH_MAX);
if ((buff = (char *)malloc((size_t)size)) != NULL)
currentPath = getcwd(buff, (size_t)size);
printf("%s $ ", currentPath);
/* Executa o comando escolhido. */
cin >> command;
if(command == "ls"){
parameter = "";
cin >> parameter;
lsMini(parameter, currentPath);
}
else if(command == "cd"){
cin >> parameter;
cdMini(parameter);
}
}
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment