https://github.com/ribeiro-boll/concha-shell
Shell basico para sistemas com ambiente compatível com POSIX, feito 100% com a linguagem C
https://github.com/ribeiro-boll/concha-shell
c-language cli linux posix shell
Last synced: about 1 year ago
JSON representation
Shell basico para sistemas com ambiente compatível com POSIX, feito 100% com a linguagem C
- Host: GitHub
- URL: https://github.com/ribeiro-boll/concha-shell
- Owner: ribeiro-boll
- License: unlicense
- Created: 2025-02-12T05:40:19.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-03-08T17:14:50.000Z (over 1 year ago)
- Last Synced: 2025-03-08T18:21:08.058Z (over 1 year ago)
- Topics: c-language, cli, linux, posix, shell
- Language: C
- Homepage:
- Size: 97.7 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

 
# 🐚 *Concha shell*


- *English version: [English version](#English)*
- *Versão pt-BR: [Versão pt-BR](#pt-BR)*
## English
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**
### Features
- **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) and `exit` (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.
### Requirements
- Linux operating system
- GCC or a compatible C compiler
- POSIX-compliant environment
### Compilation
Clone the repository and compile the source code using GCC:
```bash
gcc -o concha concha.c -lreadline
```
## pt-BR
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**
### Funcionalidades
- **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) e `exit` (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.
### Requisitos
- Sistema operacional Linux
- GCC ou um compilador C compatível
- Ambiente compatível com POSIX
### Compilação
Clone o repositório e compile o código-fonte usando o GCC:
```bash
gcc -o concha concha.c -lreadline
```