https://github.com/guilhermenobrega/shell-scripting
Study Codes
https://github.com/guilhermenobrega/shell-scripting
bash-script bash-scripting bourne-again-shell bourne-shell bourne-shellscript ideascripting ksh linux linux-shell logic-programming logical-programming shell-script shell-scripting shell-scripts shellscript tux-linux unix
Last synced: 4 months ago
JSON representation
Study Codes
- Host: GitHub
- URL: https://github.com/guilhermenobrega/shell-scripting
- Owner: GuilhermeNobrega
- Created: 2024-03-12T13:14:54.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2025-08-18T14:16:55.000Z (5 months ago)
- Last Synced: 2025-08-18T16:18:26.128Z (5 months ago)
- Topics: bash-script, bash-scripting, bourne-again-shell, bourne-shell, bourne-shellscript, ideascripting, ksh, linux, linux-shell, logic-programming, logical-programming, shell-script, shell-scripting, shell-scripts, shellscript, tux-linux, unix
- Language: Shell
- Homepage:
- Size: 62.5 KB
- Stars: 8
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🚀 Introdução ao Shell Scripting
O Shell Scripting é uma poderosa ferramenta que permite a automação de tarefas no sistema operacional usando scripts escritos em shell, como o Bash. Neste tutorial, você aprenderá conceitos básicos e como começar a escrever seus próprios scripts em Shell.
## 🤖 O que é Shell Scripting?
Shell Scripting refere-se à escrita de scripts (sequências de comandos) para serem executados no shell do sistema operacional. Os scripts podem conter comandos shell, estruturas de controle de fluxo e variáveis, permitindo automação eficiente de tarefas.
## 📝 Como Escrever um Script Simples
Para começar, crie um arquivo com a extensão `.sh` usando um editor de texto como o `nano` ou `vim`. Por exemplo, `meuscript.sh`.
Dê permissão de execução ao seu script:
```bash
111 rwx (7)
110 rw- (6)
101 r-x (5)
100 r-- (4)
011 -wx (3)
010 -w- (2)
001 --x (1)
000 --- (0)
ou..
chmod +x meuscript.sh
# 📝 Como Escrever um Script Simples
Adicione o seguinte código ao script:
```bash
#!/bin/bash
# Seu primeiro script em Shell
echo "Olá, Mundo!"
# Executar comando
# Para isso, digite: ./meuscript.sh OU bash meuscript.sh
```
## ShellCheck
O ShellCheck é uma ferramenta de análise estática para scripts de shell que ajuda a identificar problemas de estilo, erros de sintaxe e possíveis melhorias de código. Este tutorial abordará a instalação do ShellCheck e seu uso básico.
## Instalação
### Linux (Debian/Ubuntu)
```
sudo apt-get install shellcheck
```
## Utilização
```bash
shellcheck nome_arquivo.sh
```
## Debug
```bash
bash -x nome_do_seu_script.sh
```
## Documentação