Skip to content

ribeiro-boll/Concha-shell

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

os license badge

🐚 Concha shell

image imagepc

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:

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:

gcc -o concha concha.c -lreadline

About

Shell basico para sistemas com ambiente compatível com POSIX, feito 100% com a linguagem C

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published