sh: Add a sleep command

This commit is contained in:
apio 2022-11-12 17:44:13 +01:00
parent fa325072ac
commit bde9a97db5

View File

@ -108,6 +108,11 @@ int command_match_builtins(command_t* cmd)
printf("pid %ld, ppid %ld, uid %d (%s), gid %d\n", getpid(), getppid(), getuid(), username, getgid());
return 1;
}
if (command_matches(cmd, "sleep"))
{
sleep(atoi(cmd->buffer + 6));
return 1;
}
if (command_matches_exactly(cmd, "clear"))
{
fputs("\033@", stdout); // clear screen. for now, escape sequences in luna are non-standard.