-
9 votes
-
Bats: Bash automated testing system for verifying that the UNIX programs you write behave as expected
8 votes -
Writing a Bash builtin in C to parse INI configs
8 votes -
kalua: an OpenWrt extension for building large mesh-networks
8 votes -
bashdb: a gdb-like debugger for Bash
10 votes -
How to write idempotent Bash scripts
7 votes -
Pure Bash bible: a collection of pure Bash alternatives to external processes
13 votes -
ShellCheck: a static analysis tool for shell scripts
25 votes -
Shellharden: a tool to semi-automate the rewriting of scripts to ShellCheck conformance
7 votes -
x86 assembler in Bash
15 votes -
FireHOL: an iptables stateful packet filtering firewall for humans
4 votes -
EasyBashGUI: a library of Bash functions to simplify adding GUIs to scripts
17 votes -
Amber: a high-level programming language that compiles to Bash
11 votes -
shite: the little hot-reloadin' static site generator from shell (assumes Bash 4.4+)
22 votes -
pass: the standard u̴n̴i̴x̴ Bash password manager
17 votes -
xz/liblzma: Bash-stage obfuscation explained
9 votes -
Bashible: an Ansible-like deployment and automation tool written in Bash
7 votes -
pseudo3d: a raycaster in Bash
12 votes -
Bash Line Editor: a line editor written in pure Bash with syntax highlighting, auto suggestions, vim modes, etc
11 votes -
Yoda: a compiler that translates Forth code into Bash functions
12 votes -
HTTP.sh: a web framework written entirely in Bash
20 votes -
ctypes.sh: a Bash plugin that provides a foreign function interface directly in your shell
10 votes -
Ba-Bash-ka: a native Clojure interpreter for scripting, designed to leverage Clojure in place of Bash
10 votes -
A Slack clone in 5 lines of Bash
20 votes -
My thoughts on writing a Minecraft server from scratch (in Bash)
25 votes -
Some surprising code execution sources in Bash
11 votes -
Today I learned that Bash has hashmaps
23 votes -
nb: a command-line and local web note-taking, bookmarking, archiving, and knowledge base application, written in 119,172 lines of Bash
16 votes -
OpenGL bindings for Bash
21 votes -
Bashly: A command-line application (written in Ruby) that declaratively generates feature-rich Bash scripts
20 votes -
Bash++: Bash with classes
13 votes -
best way to go about with a script that seems to need both bash and python functionality
Gonna try and put this into words. I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them. My issue is I often do a thing where if I want to...
Gonna try and put this into words.
I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them.
My issue is I often do a thing where if I want to accomplish a task that is maybe a bit complex, I feel like I have to wind up making a script, let's call it
hello_word.sh
but then I also make a script called.hello_world.py
and basically what I do is almost the first line of the bash script, I call the python script like
./hello_world.py $@
and take advtange of theargparse
library in python to determine what the user wants to do amongst other tasks that are easier to do in python like for loops and etc.I try to do the meat of the logic in the python scripts before I write to an
.env
file from it and then in the bash script, I will doset -o allexport source "${DIR}"/"${ENV_FILE}" set +o allexport
and then use the variable from that env file to do the rest of the logic in bash.
why do I do anything in bash?
cause I very much prefer being able to see a terminal command being executed in real-time and see what it does and be able to
Ctrl+c
if I see the command go awry.in python, you can run a command with
subprocess
or other similar system libraries but you can't get the output in real-time or terminate a command preemptively and I really hate that. you have to wait for the command to end to see what happened.But I feel like there is something obvious I am missing (like maybe bash has an argparse library I don't know about and there is some way to inject the concept of types into it) or if there is another language entirely that fits my needs?
6 votes -
What are some startup scripts you have on your daily driver?
In the everlasting quest to customize my laptop and make my life easier, I'm looking for any ideas for startup scripts to run on user login. Personally, I don't know how to write bash scripts yet...
In the everlasting quest to customize my laptop and make my life easier, I'm looking for any ideas for startup scripts to run on user login.
Personally, I don't know how to write bash scripts yet and unfortunately I won't have time to pick it up on the side in the near future seeing as how I'm swamped between my studies and work—nevertheless, it's always nice to see how others might have under the hood for future tinkering :)
I'm currently running i3-gaps on Arch Linux. I have a few programs that I like to run inside i3's config file (Polybar, firefox, file manager, Thunderbird) every time I start i3.
The problem that I seem to have is that I lack imagination. I don't know the potential of what else I could be doing with startup scripts, so I'm turning to Tildes to see what you guys might have.6 votes -
Share your useful shell scripts!
Disclaimer: Don't run scripts offered to you by randos unless you trust them or review it yourself I use this constantly, it just plays music by file name, specifically matching *NAME* with...
Disclaimer: Don't run scripts offered to you by randos unless you trust them or review it yourself
I use this constantly, it just plays music by file name, specifically matching
*NAME*
with case-insensitivity. Requires bash 4.something.# play -ln SONGS ... # -l don't shuffle # -n dry run mpv_args="--no-audio-display --no-resume-playback \ --msg-level=all=status --term-osd-bar" shopt -s globstar nullglob nocaseglob shuffle=true dry=false while [[ "$1" == -* ]]; do if [[ "$1" == "-l" ]]; then shuffle=false elif [[ "$1" == "-n" ]]; then dry=true fi shift 1 done if [[ "$shuffle" == true ]]; then mpv_args="--shuffle $mpv_args" fi songs=() while [[ "$#" != 0 ]]; do songs+=( ~/music/**/**/*"$1"*.* ) # change this to match your music directory layout shift 1 # could probably use find instead done if [[ "$dry" == true ]]; then if [[ "$shuffle" == true ]]; then printf "Shuffle mode is on\n" fi for song in "${songs[@]}"; do printf "$song\n" done exit fi if [[ ${#songs[@]} != 0 ]]; then mpv $mpv_args "${songs[@]}" fi
I make no claims to the quality of this but it works!
36 votes