r_bash – Telegram
My bash power toys

I'm happy to bring my own dotfiles to this channel.
https://gitlab.com/hambled/dotfiles

I've been working on it daily for years and have built a lot of tools that I find very useful in my day-to-day work as a sysadmin.

This dotfiles includes interesting tools such as a file explorer (built on fzf), a tool for inspecting commands, variables, and manuals, another for managing various histfiles (contexts) and many more.

The main issue you might have is that it's in Spanish, but it's my native language and the one I feel most comfortable with. I apologize for that "inconvenience."

Bye!

https://redd.it/1pci2vf
@r_bash
Tmux not starting from noscript

\#!/bin/bash

\#python study workspace

hyprctl dispatch workspace 1

hyprctl dispatch exec "kitty -e sh -lc '/usr/bin/tmux a -t cs50p || /usr/bin/tmux exec bash'"

sleep 2

hyprctl dispatch exec brave "https://www.youtube.com/playlist?list=PLhQjrBD2T3817j24-GogXmWqO5Q5vYy0V \\

https://cs50.harvard.edu/python/psets/6/ \\

https://github.com/cyberseekerx"

sleep 3

hyprctl dispatch workspace 10

hyprctl dispatch exec kitty "\~/Videos/"

\## the problem here is that when I try to use this noscript fresh start (as in after booting)
\#but works after starting tmux instance other things work

thanks for you'r help in advance

https://redd.it/1pcwa64
@r_bash
I wrote a Bash wrapper for Nmap & Gobuster with HTML reporting (AlienTec Recon V2.0)

Hi r/bash,

I've been working on a project to practice my noscripting skills and automate my daily pentesting workflow. I just released Version 2.0 and would love some feedback on the code and logic.

What is it?

It's a native Bash noscript that orchestrates Nmap (Port scanning) and Gobuster (Directory forcing) into a single flow. It parses the output and generates a clean HTML report at the end.

The Script Features:

🐧 Pure Bash: Runs natively on Linux (Kali/Parrot) without Python dependencies.
🚀 Orchestration: Handles background processes for scanning.
📄 Reporting: Uses `cat` and heredocs to generate a styled HTML report.
🔍 Logic: Automatically detects if the target is internal or external to adjust scan intensity.

Repository:
https://github.com/AlienTec1908/AlienTec-Recon-Tool

I'm open to code reviews! If you see any bad practices or ways to optimize the loops/arrays, let me know.

Thanks!

https://redd.it/1pecxw3
@r_bash
Llib - I created a Bash library with argument parsing, finally and much more

I’ve been playing with Bash for a few years now. Every time I ran into something that I feel is missing, I try to hack together a solution. After enough time this turned into a whole library: [
https://kamilcuk.github.io/L\lib/](https://kamilcuk.github.io/Llib/) . Few modules changed how I write Bash.

[L\
argparse](https://kamilcuk.github.io/Llib/section/argparse/) has argument parsing with interface like Pythons argparse. I never liked existing argument parsing libraries in Bash, so I wrote my own (yay!). It generates helps, has shell completion, colors, subparsers, function subparsers and more.

[L\
finally](https://kamilcuk.github.io/Llib/section/finally/) allows to register a cleanup function that is always run on noscript exit. Or on the current function return, whichever comes first. Functions can nested, each function call has own cleanups. Finally a useful use of the RETURN trap, that trap is shared between all Bash functions. This ended up being more useful then I expected.

[L\
setx](https://kamilcuk.github.io/Llib/section/stdlib/?h=lsetx#Llib.sh--Lsetx) just enables set -x for one command and then unsets it. Stupidly simple, insanely useful, I am surprised how often I slap "L_setx", because it unsets -x automatically, making the output clearer. There is also L_unsetx.

L\_print\_traceback prints the traceback similar to Python. I found this post ages ago. I like using set -e and trap ERR and printing traceback on error. Plus helpers like L\_assert L\_panic very simple function, I think everyone implements something like this.

The project grew far larger than I intended, partly as my like research project if it is possible to implement Bash standard library. I doubt it is finished. There are probably many more bugs. Either way, I use parts of the library daily within my noscripts.

Full source: https://github.com/kamilcuk/L\_lib/ . That's all, live long and have fun.

https://redd.it/1pfmzot
@r_bash
Help

Hello!
I am a young developer from India , developing for a startup , can anybody tell me how may I customize whole linux gui with my own writen HTML , CSS and JS code, how to connect them with my backend, I want to run my own gui in top of gnome of linux mint , please help me. I don't have a lot of experience but a very curious and creative mind..plz help

https://redd.it/1pft0zq
@r_bash
throt: bash utility for delay a cli command and run it only once

https://github.com/hmepas/throt

Mac OS X installation thru brew:
brew tap hmepas/homebrew-throt
brew install throt

Or just download
curl -o ~/bin/throt https://raw.githubusercontent.com/hmepas/throt/refs/heads/main/throt && chmod +x ~/bin/throt
(or whatever)

Usage example:
throt --delay 5 yabairearrangespaces.sh

What's the idea. I.e. I have a yabai trigger for changing display layout (adding 2nd monitor or removing it) the problem is this trigger is noisy for comming out of sleep it could be fired several times, first for removing monitor and second for adding it back again when OS recognize it's have one. Also I do not need to run my rearrange displays noscript imideately, since I need to give system itself time to react and yabai time to adjust first. Also there is no reason to run this rearranging twice, first there are possibly be race condition and secondly it's just don't neccessary. So i wrote a simple bash noscript which on the first run create a lock file and detached proccess with sleep <sec> inside. After sleep is done the command is fired. And all calls before that will be just dissmissed for that particular command.
Enjoy!


https://redd.it/1pfn0si
@r_bash
Get filename expansion to work with “here strings”?

Unless -f is specified, bash expands filenames as stated here:

% echo /var/cache/*
/var/cache/apk /var/cache/misc


But I was pretty surprised that this one didn’t work as expected:

cat <<< /var/cache/*
/var/cache/*


In this page about here strings it’s clearly written:

> Filename expansion and word splitting are not performed.

There is no information on how to get filename expansions to work with this syntax. Shell flags? Patches? Workarounds? Any particular reason why it does variable expansion in here strings, but not filename one?

Thanks!





https://redd.it/1ph92p9
@r_bash
I made this Bash keyboard shortcuts map because I was tired of forgetting them 😅

Hey everyone!



I’ve always seen visual “keyboard maps” for apps like GIMP, Photoshop, Blender,

etc. — where each key is labeled with its shortcut. But I realized I had never

seen a version of that style specifically for Bash / Readline shortcuts.



So I decided to design one.



Part of the inspiration came from the classic Vi/Vim cheat sheet from ViEmu:

http://www.viemu.com/a\_vi\_vim\_graphical\_cheat\_sheet\_tutorial.html

What I really liked was how it uses the keyboard itself as the visual foundation,

and how the shortcuts are introduced progressively rather than all at once.

I wanted to recreate that idea for Bash/Readline, since most Bash shortcut

references are just plain text lists.



Following that concept, I made **four versions** of the Bash shortcuts map,

ranging from a very basic level to more advanced ones, so learners can progress

naturally as they get more comfortable with Readline.



Here’s the image:



Bash cheatsheet full version



The full set of versions is available here:

https://github.com/Athesto/cheatsheets



Features:

• Cursor and word movement

• Reverse/forward history search

• Kill/yank/transpose editing commands

• Ctrl, Meta (Alt/Opt), and Shift combos

• Color-coded categories

• Based on Readline defaults

• 4 progressive levels available in the repo



License (CC BY-SA 4.0):

You’re free to use, share, remix, or include this in teaching materials

(including commercial ones) as long as proper credit is given and derivative

works are shared under the same license. I wanted people to reuse it without

worrying about permissions.



Hope this helps anyone learning or teaching Bash!

Feedback and suggestions are very welcome.

https://redd.it/1phy40k
@r_bash
Help me on good shebang practice !!

as i knew that its a good practice to add shebang in the starting of noscript, i used it in all my projects. `#!/bin/bash` used it in my linutils and other repositories that depend on bash.


but now i started using NixOS and it shows bad interprator or something like that(an error).

i found about `#/usr/bin/env bash`

should i use it in all my repositories that need to run on debian/arch/fedora. i mean "is this shebang universally acceptable"

https://redd.it/1pi50s9
@r_bash
bash bash bash

idk pero hindi talaga ako nagagandahan don sa fAt!m@ A. na content creator galing sa tiktok 😭 ang oa niy for me. naiinis ako sa pag,umukha niya. ako lang ba like they aint cute bro they look like baliw


https://redd.it/1pi69xh
@r_bash
New or Old Bash guide

I see the bash tutorial in the side bar has a new version but the sub lists the old one. Which is recommended?

https://redd.it/1piqz4y
@r_bash
Why doesnt this command work on a mac?

Input

echo "Udemy - The AI Engineer Course 2025 Complete AI Engineer Bootcamp (8.2025)" | sed -E 's/\s+/-/g'

Output

Udemy - The AI Engineer Cour-e 2025 Complete AI Engineer Bootcamp (8.2025)


https://redd.it/1pivezi
@r_bash
I'm attempting to mimic multi-dimensional arrays for a personal use noscript. What I am currently doing is wrong and I can't seem to find a way to do it correctly.

\#List_out is an output of a func that generates surnames, traits and other information

\#List_out is currently a generated Surname
surnames+=("$List_out") #list of every surname

declare -a $List_out #list of connected items to the surname

\#List_out is now a first name connected to the most recently generated surname
eval "${surnames[-1\]}+=("$List_out")"

declare -A $List_out #name of individual (store characteristics)

\#List_out is now a chosen string and quirks is supposed to be the key for the associative array that was just defined
\#the second -1 refers to the last generated name in the array
eval "${{surnames[-1\]}[-1\]}[Quirks\]=$List_out"

If anyone has any suggestions I would be very grateful.

https://redd.it/1pjat85
@r_bash
noob Can simple noscript with mapfile be improved?

I have this simple noscript that finds empty directories recursively, opens a list of them with vim for user to edit (delete lines to omit from removal), then on save and exit, prints the updated list to prompt for removal.

Can the noscript be simplified? Open to all constructive criticism, however minor and nitpick, as well as personal preferences from experienced bash users.

Note: fd is not as standard as find command and I don't see the point of avoiding bashisms in the noscript since arrays were used anyway.

https://redd.it/1pjmqff
@r_bash
What the heck did I put in my bashrc?

I put this line in my .bashrc years ago:

bat () { echo "$(<"$@")" ; }

But I have been away from Linux since then. I tried it on my new installation (different distro) and get this error:

bash: "$@": ambiguous redirect

Anybody have any idea what I was thinking then?

https://redd.it/1pl635u
@r_bash