r_bash – Telegram
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
PID
if [ ${#pids[@]} -eq 0 ] || [ -z "${pids[0]:-}" ]; then
echo "No processes found matching '$proc_name'." >&2
exit 1
fi

# Show current nice values
if [ "$action" = "check" ]; then
for pid in "${pids[@]}"; do
nice_val=$(ps -o ni= -p "$pid" | tr -d ' ')
echo "$proc_name \"PID: $pid\" is currently set to $(priority_desc "$nice_val")"
done
exit 0
fi

# Renice if numeric argument
if [[ "$action" =~ ^-?[0-9]+$ ]]; then
if (( action < -20 || action > 20 )); then
echo "Error: nice value must be between -20 and 20." >&2
exit 1
fi
for pid in "${pids[@]}"; do
if renice "$action" -p "$pid" &>/dev/null; then
echo "$proc_name \"PID: $pid\" has been adjusted to $(priority_desc "$action")"
else
echo "Failed to renice PID $pid (permission denied?)" >&2
fi
done
exit 0
fi

# Invalid action provided
echo "Invalid action: must be 'check' or a numeric nice value." >&2
usage
```


https://redd.it/1migur6
@r_bash
Practicing bash

Hello folks, I have started to learn bash for DevOps, what are some ways I can practice bash noscripts to get a good hands-on and become comfortable using it

https://redd.it/1ml24gb
@r_bash
using parenthesis for execution

Is there any advantage or disadvantage to using parenthesis for the following execution of the "find" command:


sudo find / \( -mtime +30 -iname '*.zip' \) -exec cp {} /home/donnie \;

as opposed to using the same command without the parenthesis like so:

sudo find / -mtime +30 -iname '*.zip' -exec cp {} /home/donnie \;

Both seem to produce the same result, so don't fully understand the parenthesis in the first "find". I am trying to make sure that I understand when and when not to use the parenthesis considering that it can affect the flow of evaluation. Just thought in this example it would not have mattered.

thanks for the help

https://redd.it/1ml3au5
@r_bash
how do we use the flag "-F" (-F from ls -Fla) in find?

Hi, I'd like to know if we can use a "highligt" for dirs in the output of find ./ -name 'something' for diff between dirs and files ...
Thank you and regards!

https://redd.it/1mls1tg
@r_bash
I can't see the advantage of vdir vs. ls -l cmd

**Hi**, I was reading about vdir (https://www.reddit.com/r/vim/comments/1midti4/vidir_and_vipe_command_utilities_that_use_vim/) and reading man vdir it is like ls -l
*What is the use of vdir cmd? what is its advantage?
*Thank you and Regards!*

https://redd.it/1mmknd6
@r_bash
Is my code good enough?

#NO slashes ( / ) at the end of the string!
startFolder="/media/sam/T7/Windows recovered files"
destinationFolder="/media/sam/T7/Windows sorted files"
#double check file extensions
#should NOT have a period ( . ) at the start
extensions=("png" "jpg" "py" "pyc" "noscript" "txt" "mp4" "ogg" "java")

declare -A counters
for extension in "${extensions@}"
do
mkdir -p "$destinationFolder/$extension"
counters$extension=0
done

folders=$(ls "$startFolder")

arrFolders=()
for folder in $folders;do
arrFolders+=($folder)
done

folderAmount=${#arrFolders@}

echo $folderAmount folders

completed=0

for folder in $folders;do
completed=$((completed+1))
percentage=$(((completed100)/folderAmount))
files=$(ls "$startFolder/$folder")
for file in $files;do
for extension in "${extensions[@]}";do
if [[ $file ==
".$extension" ]];then
filePath="$startFolder/$folder/$file"
number="${counters[$extension]}"
destPath="$destinationFolder/$extension/$number.$extension"
echo -n -e "\r\e[0K$completed/$folderAmount $percentage% $filePath -> $destPath"
mv "$filePath" "$destPath"
counters[$extension]=$((counters[$extension]+1))
break
fi
done
done
done

echo
#NO slashes ( / ) at the end of the string!
startFolder="/media/sam/T7/Windows recovered files"
destinationFolder="/media/sam/T7/Windows sorted files"
#double check file extensions
#should NOT have a period ( . ) at the start
extensions=("png" "jpg" "py" "pyc" "noscript" "txt" "mp4" "ogg" "java")


declare -A counters
for extension in "${extensions[@]}"
do
mkdir -p "$destinationFolder/$extension"
counters[$extension]=0
done


folders=$(ls "$startFolder")


arrFolders=()
for folder in $folders;do
arrFolders+=($folder)
done


folderAmount=${
#arrFolders[@]}


echo $folderAmount folders


completed=0


for folder in $folders;do
completed=$((completed+1))
percentage=$(((completed
100)/folderAmount))
files=$(ls "$startFolder/$folder")
for file in $files;do
for extension in "${extensions@}";do
if [ $file == *".$extension"* ];then
filePath="$startFolder/$folder/$file"
number="${counters$extension}"
destPath="$destinationFolder/$extension/$number.$extension"
echo -n -e "\r\e0K$completed/$folderAmount $percentage% $filePath -> $destPath"
mv "$filePath" "$destPath"
counters[$extension=$((counters$extension+1))
break
fi
done
done
done


echo

It organized the folders generated by PhotoRec (salvaging files from a corrupt filesystem).

The code isn't very user friendly, but it gets the job done (although slowly)

I have released it on GitHub with additional instructions: https://github.com/justbanana9999/Arrange-by-file-type-PhotoRec-

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