Skip to content

Alief1150/bash-conditional-expressions

Repository files navigation

Bash Conditional Expressions

Bash Conditional Expressions logo

Bash badge Bubble Tea badge Go badge Platform badge

Simple Bash Script with TUI framework

Project overview

This project is a collection of Bash conditional-expression exercises and one Bubble Tea TUI application that wraps the tasks in an interactive terminal interface.

The main TUI app lives in bubbletea_tui/.

Main features

  • number classification with Bash conditions
  • file validation checks
  • student name validation
  • grade classification
  • simple menu workflow with case
  • assignment validation for submission folders
  • log audit / regex / pipeline demo

Credits

  • Bubble Tea TUI by Charmbracelet
  • Bubbles and Lip Gloss by Charmbracelet
  • original shell expression practice structure from the shell_expr_project

Project files

  • bubbletea_tui/ — main interactive TUI app
  • latihan_1.sh to latihan_5.sh — condition/test practice scripts
  • studi_kasus_validasi_tugas.sh — submission validation example
  • audit_log.sh — combined audit/log example
  • tugas.sh — supporting task script

How to run

Linux distributions

  1. Install Bash and Go.

    Debian/Ubuntu:

    sudo apt update
    sudo apt install bash golang-go

    Fedora:

    sudo dnf install bash golang

    Arch Linux:

    sudo pacman -S bash go
  2. Run the TUI:

    cd bubbletea_tui
    go mod tidy
    go run .
  3. Controls:

    • ↑/↓ or j/k to navigate
    • Tab to switch fields
    • Enter or r to run
    • e to export result
    • Esc to go back
    • q to quit

Windows

Recommended: use Windows Terminal with PowerShell, Git Bash, or WSL.

  1. Install Go for Windows from https://go.dev/dl/
  2. Open a terminal in the project folder.
  3. Run:
    cd bubbletea_tui
    go mod tidy
    go run .

If the terminal UI looks odd in old CMD, switch to Windows Terminal or Git Bash.

Simple usage notes

  • The TUI is the main entry point for exploring the project interactively.
  • The Bash scripts can still be run directly if you only want the CLI exercises.
  • The project is designed for teaching Bash test operators and conditional expressions.

Example direct Bash script usage

chmod +x *.sh
./latihan_1.sh
./latihan_2.sh
./latihan_3.sh
./latihan_4.sh
./latihan_5.sh
./studi_kasus_validasi_tugas.sh
./audit_log.sh sample.log ERROR

Warning

  • go run . must be executed inside bubbletea_tui/.
  • Some scripts expect specific input values or files.
  • If you run audit_log.sh, make sure the log file exists.
  • For best TUI experience, use a modern terminal emulator.

Repository context

See README-Project-Context.md for the full assignment context and learning goals.

About

Simple Bash Script with TUI framework

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors