-
English version: English version
-
Versão pt-BR: Versão pt-BR
A simple shell implemented in C for educational purposes. It provides basic command execution, directory navigation, and minimal signal handling.
Now with:
- Logic operators ('&&', '||' ou ';') and pipe operator ( '|' )
- Command history
- Arrow keys are now usable for editing the command input
- Change Directory (
cd
): Changes the current directory. If no argument is provided, defaults to the directory ($HOME). - List Directory Contents (
ls
): Displays the contents of the current directory. - Clear Screen (
cls
): Clears the terminal window. - Clear History (
hcls
): clears the file that stores the command and deletes the current history. - Built-in Commands: Includes
help
(displays available commands) andexit
(exits the shell). - Execution of External Commands: If a command is not built-in, the shell attempts to execute it using the system PATH.
- Signal Handling: Captures SIGINT (Ctrl+C) and provides a custom message.
- Linux operating system
- GCC or a compatible C compiler
- POSIX-compliant environment
Clone the repository and compile the source code using GCC:
gcc -o concha concha.c -lreadline
Um shell simples implementado em C para fins educacionais. Ele fornece execução básica de comandos, navegação de diretórios e tratamento mínimo de sinais.
Agora com:
- Operadores lógicos ('&&', '||' ou ';') e operador pipe ('|')
- Histórico de comandos
- As teclas de seta agora podem ser usadas para editar a entrada de comandos
- Mudar Diretório (
cd
): Altera o diretório atual. Se nenhum argumento for fornecido, utiliza como padrão o diretório ($HOME). - Listar Conteúdo do Diretório (
ls
): Exibe o conteúdo do diretório atual. - Limpar a Tela (
cls
): Limpa a janela do terminal. - Limpar o Historico (
hcls
): limpa o arquivo que guarda os comandos e apaga o historico atual - Comandos Internos: Inclui
help
(exibe os comandos disponíveis) eexit
(encerra o shell). - Execução de Comandos Externos: Se um comando não for interno, o shell tenta executá-lo utilizando o PATH do sistema.
- Tratamento de Sinais: Captura SIGINT (Ctrl+C) e exibe uma mensagem customizada.
- Sistema operacional Linux
- GCC ou um compilador C compatível
- Ambiente compatível com POSIX
Clone o repositório e compile o código-fonte usando o GCC:
gcc -o concha concha.c -lreadline