r_bash – Telegram
Infant's request from experts as someone who is entering the world of Bash as a tool

For context I switched to Linux 3 weeks ago on a Debian based architecture and I have fallen in love with it but I am not using to its best potential. I want to switch to arch Linux and I am currently learning by testing in on a Virtual Environment (qemu-kvm) in particular .What is the best way to go about learning bash from scratch, noscripting and eventually becoming an expert given I am also done and expecting graduation soon in electrical and telecommunications and on my research I have learnt that backbone of telecoms and Networking as a whole is Linux. Any advise is highly appreciated as I want to commit fully into learning the language and the best way is always asking the experts.

https://redd.it/1mbm6gw
@r_bash
How to clear cache and cookies across all browsers for localhost:3002?

You have a specific website localhost:3002
You have firefox, safari and chrome installed
You want to clear cache and cookies for this website across all browsers
Anyone know if this is doable with a bash noscript?

https://redd.it/1mc3c6s
@r_bash
How do fill the next prompt

Is there a command or way to make a a noscript that works like the following
$ inject "echo test"
$ echo test
without executing echo test

https://redd.it/1mc4296
@r_bash
An app that lets you view a live snapshot of your shell output

Hi,

I’m thinking about making a small app that shows a live view of your shell output — like tail -f or noscript output — in a clean, glassy overlay on your phone screen (maybe even on a widget). It’s useful for monitoring the status of running code, for instance.

Would you use and maybe pay a 1 time fee for something like that? Thanks!

View Poll

https://redd.it/1mcnhc4
@r_bash
Why is rsync not escaping spaces? At my wit's end.

Pretty sure I tried all the forms of escaping spaces by now, I just can't figure it out, so please forgive what may be a beginner question:

Because Windows 11 is a @#$ and Microsoft a @#$, I am trying to use a 64 GB NTFS partition on nvme 0n1 as a cross platform place to synchronize things but OpenSUSE LEAP 15.6 doesn't always have an easy time mounting it automatically at /mnt/CROSSPLATFORM.

So I decided, set a $DIR variable based on which, mounting in XFCE, or mounting through fstab, happens. That way if fstab fails to mount to /mnt/CROSSPLATFORM, it will pick up on that and go to the manually mounted /run/media/fool/etc.....

But rsync keeps complaining that it cannot change directories to the directory. And then it will sometimes create the directory with the escape characters. I've tried no escapes, escapes, no quotes, single quotes, double quotes, and I can't get it to simply see that the two destinations have spaces in the name. Error:

sending incremental file list

rsync: [sender] change_dir "/run/media/fool/CROSSPLATFORM/Documents/Games/Baldurs\ Gate\ 3" failed: No such file or directory (2)

created directory /home/fool/Documents/Games/Baldurs\ Gate\ 3

sent 19 bytes received 80 bytes 198.00 bytes/sec

total size is 0 speedup is 0.00

rsync error: some files/attrs were not transferred (see previous errors) (code 23) at main.c(1336) [sender=3.2.7]

Here's the bash noscript that I'm trying to fix:

#!/bin/bash

if mountpoint -q /run/media/fool/CROSSPLATFORM

then

DIR="/run/media/fool/CROSSPLATFORM/Documents/Games/Baldurs\ Gate\ 3/"

else

DIR="/mnt/CROSSPLATFORM/Documents/Games/Baldurs\ Gate\ 3/"

fi

rsync -av --progress --delete "$DIR" "/home/fool/Documents/Games/Baldurs\ Gate\ 3/"



https://redd.it/1mcqpgo
@r_bash
Expect noscript will not run in cron

I have a noscript that I run every night via cron as root. I set the path in the top of the crontab. The noscript kicks off a expect command to spawn a lftp session. Everything works great when I run the noscript via interactive, but when I run it via cron, the file never gets sent. The log doesn't show any errors. The comment from the parent noscript is:


expect -f expect_noscript.txt


and the content of the expect_noscript.txt is below:




set timeout 60

set prompt "lftp *"

set FTP_HOST "waws-prod-ch9-051.ftp.azurewebsites.windows.net"

set LOCAL_FILE "/public/ra_reports/*.html"

spawn lftp ftp://$FTP_HOST



# send User and Password

expect {

$prompt { send "user USERID\\PASSWORD\r" }

timeout { puts "Timed out"; exit 1}

}



# change DIR to ra_reports

expect {

$prompt { send "cd /site/wwwroot/ra_reports\r" }

timeout { puts "Timed out"; exit 1}

}



# put HTML files

expect {

$prompt { send "mput $LOCAL_FILE\r" }

timeout { puts "Timed out"; exit 1}

}





send "bye\r"

expect eof



https://redd.it/1me3j2i
@r_bash
Help, Can't get the code to be running in bash

$ cd "e:\Sculptures\Dustbin\Random\" && g++ sumthin.cpp -o sumthin && ./sumthin

this is the only output

https://redd.it/1mef8v8
@r_bash
Any good AI tool that can help generate noscripts?

Hi,

Anyone using a good AI tool to automate noscript generation, testing and implementation? Looking for some suggestions on some good tools.

https://redd.it/1meusjg
@r_bash
An open-source AI that turns plain English into terminal commands

Vity is an open-source terminal assistant that lets you turn natural language instructions into shell commands.

Built for those of you who are not command-line wizards, but still occasionally need to battle the terminal.

In addition to generating commands, Vity also lets you ask questions based on your terminal history.

Vity adds the generated command to terminal history, but NEVER executes it automatically. Instead, it prints the command, and lets you retrieve the command with a simple press on UP ARROW key.

Vity is fully open source, and it supports all OpenAI compatible LLM providers, including Ollama, VLLM and other self-hosted options.

Supports all major providers: Claude, Gemini, OpenAI, Ollama, VLLM etc

Vity is open-source on GitHub – try it out!

Try vity: https://github.com/kaleab-ayenew/vity

https://redd.it/1mf9689
@r_bash
Prompt persistente desde Bash — sin memoria externa, ni RAG, solo texto 🧠

Hay una forma de mantener “memoria” y personalidad en modelos locales (llama.cpp) solo usando Bash. Sin herramientas raras ni cosas externas.
El personaje se llama **R12D12** y responde como si fuera un robot técnico, sin florituras.

Básicamente:

* El comportamiento está dentro del propio prompt .txt
* Se lanza desde Bash con llama.cpp
* Y aunque el modelo no tiene memoria real, se mantiene estable solo por cómo está escrito el texto.

[Sin RAG, sin embeddings, sin API. Todo vive en texto plano.](https://preview.redd.it/6k0jssfwkrgf1.png?width=3456&format=png&auto=webp&s=7b316c9b8384b0394f3e425fd75ce2d95fd187a8)

📎 [https://github.com/BiblioGalactic/Robotsdelamanecer](https://github.com/BiblioGalactic/Robotsdelamanecer)

¿Alguien más jugando con esto en terminal? ¿O soy el raro? 🤖

https://redd.it/1mge63i
@r_bash
edit-and-execute-command ignores $VISUAL when set -o posix -o vi

When bash is run in posix and vi mode, it seems edit-and-execute-command ignores both $VISUAL, $EDITOR and $FCEDIT, and instead uses vi. Are anyone able to reproduce this?

$ set -x -o posix -o vi
$ export EDITOR=vim
$
# press v when in command mode
++ fc -e vi
+++ vi /tmp/bash-fc.kBdfnM
$

But when run in emacs mode with set -o emacs, it correctly uses the program specified by the env vars. Is this a bug or expected behavior?

https://redd.it/1mfvvh2
@r_bash
☄️ Structured Personality AI Experiment (llama.cpp)

previous tests with “Alex” and R12D12, here’s a collection of entities with predefined behavior. These are not general-purpose chatbots, but functional narrative profiles — each with its own internal framework.

Robots:

HAL\_10
Da1ta1
Vender
CC-33PPOO

Each one:

🤖 responds from within its role, not from the user’s intent
🫡 maintains tone, structure, and narrative constraints
🎭 doesn’t improvise, it interprets
🔄 doesn’t hallucinate, it follows internal logic

Designed to run fully offline — no RAG, no embeddings, no external dependencies.
Just prompt engineering, modular structure (prompt.txt, config, README, and per-profile examples).
Repository:
(http://github.com/BiblioGalactic/Robotsdelamanecer)
Can serve as a base for operational simulation, narrative training, or controlled interaction with role-based AIs under local execution.
Signed: Eto Demerzel
Motto: If something can be narrated, it can be replicated.

https://redd.it/1mgunx4
@r_bash
Bash 100%

>🧠 Estoy trabajando en un sistema de personalidades IA usando llama.cpp completamente en local. Toda la orquestación está hecha en Bash con modularidad por perfiles (prompt.txt, config, launcher.sh, etc.).

>

>¿Alguien más ha trabajado con Bash para estructurar prompts o manejar memoria contextual? Estoy usando distancia Levenshtein + control de tokens, y me encantaría feedback técnico sobre la arquitectura de los noscripts.

https://redd.it/1mh36rp
@r_bash
Cloned Revolut App

🛑 I’m facing some problems with: ExpoModulesCore, some classes and cocoa pods I’ve been stuck for 6h. I would grateful if someone could help me out 🥲

https://redd.it/1mh90v8
@r_bash
Newbie - Need help understanding an error in my noscript

Hey guys, I have a basic bash noscript I made for the purpose of checking for any disconnected file shares (missing mount points) on my proxmox VE host and automatically attempting to re-map the missing shares. This is so that if my NAS turns on after my proxmox VE host for any reason, I won't have to log into the host manually and run "mount -a" myself.

This is literally my first bash noscript beyond the usual "Hello World!" (and first noscript of any kind outside of basic AutoHotkey noscripts and some light PowerShell). At this stage, my noscript is working and serving its intended purpose along with an appropriate cron job schedule to run this noscript every 5 minutes, however I am noting an error "./Auto-Mount.sh: line 59: : command not found" every time the noscript runs and finds that a file share is missing and needs to be reconnected. If the noscript exits after finding that all file shares are already connected, this error is not logged. Regardless of this error, the noscript functions as expected.

I have identified which line (line 59: if "$any_still_false"; then) is throwing the error but I can't for the life of me understand why? Any help you guys could offer would be awesome... Feel free to constructively critique my code or documentation as well since it's my first go!

Side note: I'm hoping entering the code into this post with a code block is sufficient to make this as readable as possible. If there's a better way of formatting this in a reddit post, please tell me so I can edit the post.

\- - - - - - - - - -

#!/bin/bash

# Define the list of mount points to be checked as statements

mount1="mountpoint -q "/mnt/nas-media""

mount2="mountpoint -q "/mnt/nas2-media""

#mount3="mountpoint -q "/mnt/nas3-backup""

#mount4="mountpoint -q "/mnt/something-else""

# Store the mount point statements in an array

# Be sure to only include current mount points that should be checked

# Any old or invalid mount points defined as statements in the array will eval to false

mount_points=(

"$mount1"

"$mount2"

)

any_false=false

# Check if each mount point exists and print to the console any that do not

for stmt in "${mount_points[@]}"; do

if ! eval "$stmt"; then

sleep 1

echo "Mount point not found: $stmt"

any_false=true

fi

done

# Evalute whether all mount points exist or not, and attempt to re-stablish missing mounts

if "$any_false"; then

sleep 1

echo "Not all mount points exist."

sleep 1

echo "Attempting to re-establish mount points in fstab..."

mount -a

sleep 2

else

sleep 1

echo "All mount points already exist."

any_still_false=false

exit 0

fi

# Check again and report any mount points still missing

for stmt in "${mount_points[@]}"; do

if ! eval "$stmt"; then

sleep 1

echo "Mount point still not found: $stmt"

any_still_false=true

fi

done

# Report on the final outcome of the program

if "$any_still_false"; then

sleep 1

echo "Failed to establish one or more mount points."

exit 1

else

sleep 1

echo "All mount points now exist."

exit 0

fi

https://redd.it/1mhf7f1
@r_bash
Personality system

🧠 I'm working on an AI personality system using llama.cpp completely locally. All orchestration is done in Bash with modularity by profiles (prompt.txt, config, launcher.sh, etc.).



Has anyone else worked with Bash to structure prompts or handle contextual memory? I'm using Levenshtein distance + token control, and I would love technical feedback on the architecture of the noscripts.

https://redd.it/1mhpciq
@r_bash
Read command resulting in a lack of logs.

In my bash noscript, I have a function that logs some stuff and then requests a user input based on the content logged before it. The issue is that those logs don't get logged until I do the user input first, which is obviously not intended. Am I doing something wrong?

I'm using:
read -p "Input: " choice

Also, if it helps, I'm using Git Bash for Windows.

Thanks for the help in advance!

https://redd.it/1mhmikx
@r_bash
Process Priority Manager

# nicemgr

## The Story

I am ashamed to admit, despite years doing sysadmin work/software development, it wasn't until today that I learned about nice values for running processes. For those of you that also are unaware, a nice value tells your OS which programs to prioritize, and by what weights, when resources are constrained.

My relevant example, a long running ffmpeg process, making it impossible to use my computer for days, but me desperately desiring to play BG3 in the evening after work. Solution: nice values. Nice indicates how willing a process is to share CPU cycles with other programs. They range from -20 through 20. Negative nice values are greedy and unwilling to share. Positive values are happy to get whatever CPU cycles are available. The higher the nice value, the happier they are to let other processes use all of your CPU resources.

The solution worked great, but I was finding it a bit of a chore going through all the steps to find the PID, check the current nice value, or adjust them as the syntax isn't the most memorable. I'm attaching a wrapper below for those interested. This can be used across macOS and most linux distros. Hope you find this helpful!!

## TLDR;
- **What “nice” is:** process priority from –20 (greedy) to +20 (polite)
- **Why it matters:** lets CPU-hog jobs yield to interactive apps
- **My use-case:** reniced ffmpeg so I could finally play Baldur’s Gate 3
- Wrapper noscript below to simplify use of this nifty tool

## Script

```
#!/usr/bin/env bash
# nicer: Check or adjust the nice values of specific processes or list all processes sorted by nice.
#
# Usage:
# nicer checkALL
# nicer <process-name> check
# nicer <process-name> <niceValue>
#
# checkALL List PID, nice, and command for all processes sorted by nice (asc).
# check Show current nice value(s) for <process-name>.
# niceValue Integer from -20 (highest) to 20 (lowest) to renice matching processes.
#
# Note: Negative nice values require root or the process owner.

set -euo pipefail

# Ensure required commands are available
for cmd in pgrep ps sort renice uname; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Error: '$cmd' command not found. Please install it." >&2
exit 1
fi
done

# Describe a nice value in human-friendly terms
priority_desc() {
local nv=$1
case $nv in
-20) echo "top priority." ;;
-19|-18|-17|-16|-15|-14|-13|-12|-11|-10)
echo "high priority level \"$nv\"." ;;
-9|-8|-7|-6|-5|-4|-3|-2|-1)
echo "priority level \"$nv\"." ;;
0) echo "standard priority." ;;
1|2|3|4|5|6|7|8|9|10)
echo "background priority \"$nv\"." ;;
11|12|13|14|15|16|17|18|19)
echo "low priority \"$nv\"." ;;
20) echo "lowest priority." ;;
*) echo "nice value \"$nv\" out of range." ;;
esac
}

# Print usage and exit
usage() {
cat <<EOF >&2
Usage: $(basename "$0") checkALL
$(basename "$0") <process-name> check
$(basename "$0") <process-name> <niceValue>

checkALL List PID, nice, and command for all processes sorted by nice (asc).
check Show current nice value(s) for <process-name>.
niceValue Integer from -20 (highest) to 20 (lowest) to renice matching processes.

Note: Negative nice values require root or the process owner.
EOF
exit 1
}

# Detect OS for ps options
OS=$(uname)
if [ "$OS" = "Linux" ]; then
PS_LIST_OPTS=( -eo pid,ni,comm ) # GNU ps
elif [ "$OS" = "Darwin" ]; then
PS_LIST_OPTS=( axo pid,ni,comm ) # BSD ps on macOS
else
echo "Unsupported OS: $OS" >&2
exit 1
fi

# Must have at least one argument
if [ $# -lt 1 ]; then
usage
fi

# Global all-process check
if [ "$1" = "checkALL" ]; then
ps "${PS_LIST_OPTS[@]}" | sort -n -k2
exit 0
fi

# Per-process operations expect exactly two arguments
if [ $# -ne 2 ]; then
usage
fi

proc_name=$1
action=$2

# Find PIDs matching process name (exact match)
# Using read -a for compatibility with Bash 3.x
read -r -a pids <<< "$(pgrep -x "$proc_name" || echo)"
# Ensure we have at least one non-empty