r_bash – Telegram
nsupdate noscript file

Sorry not sure how to describe this.

for bash noscript file i can start the file with

\#!/bin/bash


I want to do the same with nsupdate ... it has ; as a comment char

I'm thinking

;!/usr/bin/nsupdate

<nsupdate commands>

or ?




https://redd.it/1m68h73
@r_bash
Bash completion: how/where to configure user created commands?

I have bash completion on my Arch linux machine. When I am `unrar`ing something, tab completion will complete the command (from unr<TAB>) for me. Hitting tab again, lists all the options that are available. After the options are covered, hitting tab again, looks for the folders and any files with `.rar` extension. If there are no folders in the directory and there is only one file with the extension `.rar`, it picks that file to complete the tab.

When I use tab completion on a program I wrote (in C), it will complete the program name, but tabbing after that only searches for a file name when that is not the next option. And the files it displays, don't have the required extension, like `unrar` does.

How can I setup my programs to behave like `unrar`?

I have run `complete` (lists nothing of `unrar`):

[code\]complete -F _comp_complete_longopt mv

complete -F _comp_complete_longopt head

complete -F _comp_complete_longopt uniq

complete -F _comp_command else

complete -F _comp_complete_longopt mkfifo

complete -F _comp_complete_longopt tee

complete -F _comp_complete_longopt grep

complete -F _comp_complete_longopt objdump

complete -F _comp_complete_longopt cut

complete -F _comp_command nohup

complete -a unalias

complete -u groups

complete -F _comp_complete_longopt texindex

complete -F _comp_complete_known_hosts telnet

complete -F _comp_command vsound

complete -c which

complete -F _comp_complete_longopt m4

complete -F _comp_complete_longopt cp

complete -F _comp_complete_longopt base64

complete -F _comp_complete_longopt strip

complete -v readonly

complete -F _comp_complete_known_hosts showmount

complete -F _comp_complete_longopt tac

complete -F _comp_complete_known_hosts fping

complete -c type

complete -F _comp_complete_known_hosts ssh-installkeys

complete -F _comp_complete_longopt expand

complete -F _comp_complete_longopt ln

complete -F _comp_command aoss

complete -F _comp_complete_longopt ld

complete -F _comp_complete_longopt ennoscript

complete -F _comp_command xargs

complete -j -P '"%' -S '"' jobs

complete -F _comp_complete_service service

complete -F _comp_complete_longopt tail

complete -F _comp_complete_longopt unexpand

complete -F _comp_complete_longopt netstat

complete -F _comp_complete_longopt ls

complete -v unset

complete -F _comp_complete_longopt csplit

complete -F _comp_complete_known_hosts rsh

complete -F _comp_command exec

complete -F _comp_complete_longopt sum

complete -F _comp_complete_longopt nm

complete -F _comp_complete_longopt nl

complete -F _comp_complete_user_at_host ytalk

complete -u sux

complete -F _comp_complete_longopt paste

complete -F _comp_complete_known_hosts drill

complete -F _comp_complete_longopt dir

complete -F _comp_complete_longopt a2ps

complete -F _comp_root_command really

complete -F _comp_complete_known_hosts dig

complete -F _comp_complete_user_at_host talk

complete -F _comp_complete_longopt df

complete -F _comp_command eval

complete -F _comp_complete_longopt chroot

complete -F _comp_command do

complete -F _comp_complete_longopt du

complete -F _comp_complete_longopt wc

complete -A shopt shopt

complete -F _comp_complete_known_hosts ftp

complete -F _comp_complete_longopt uname

complete -F _comp_complete_known_hosts rlogin

complete -F _comp_complete_longopt rm

complete -F _comp_root_command gksudo

complete -F _comp_command nice

complete -F _comp_complete_longopt tr

complete -F _comp_root_command gksu

complete -F _comp_complete_longopt ptx

complete -F _comp_complete_known_hosts traceroute

complete -j -P '"%' -S '"' fg

complete -F _comp_complete_longopt who

complete -F _comp_complete_longopt less

complete -F _comp_complete_longopt mknod

complete -F _comp_command padsp

complete -F _comp_complete_longopt bison

complete -F
_comp_complete_longopt od

complete -F _comp_complete_load -D

complete -F _comp_complete_longopt split

complete -F _comp_complete_longopt fold

complete -F _comp_complete_user_at_host finger

complete -F _comp_root_command kdesudo

complete -u w

complete -F _comp_complete_longopt irb

complete -F _comp_command tsocks

complete -F _comp_complete_longopt diff

complete -F _comp_complete_longopt shar

complete -F _comp_complete_longopt vdir

complete -j -P '"%' -S '"' disown

complete -F _comp_complete_longopt bash

complete -A stopped -P '"%' -S '"' bg

complete -F _comp_complete_longopt objcopy

complete -F _comp_complete_longopt bc

complete -b builtin

complete -F _comp_command ltrace

complete -F _comp_complete_known_hosts traceroute6

complete -F _comp_complete_longopt date

complete -F _comp_complete_longopt cat

complete -F _comp_complete_longopt readelf

complete -F _comp_complete_longopt awk

complete -F _comp_complete_longopt seq

complete -F _comp_complete_longopt mkdir

complete -F _comp_complete_minimal ''

complete -F _comp_complete_longopt sort

complete -F _comp_complete_longopt pr

complete -F _comp_complete_longopt colordiff

complete -F _comp_complete_longopt fmt

complete -F _comp_complete_longopt sed

complete -F _comp_complete_longopt gperf

complete -F _comp_command time

complete -F _comp_root_command fakeroot

complete -u slay

complete -F _comp_complete_longopt grub

complete -F _comp_complete_longopt rmdir

complete -F _comp_complete_longopt units

complete -F _comp_complete_longopt touch

complete -F _comp_complete_longopt ldd

complete -F _comp_command then

complete -F _comp_command command

complete -F _comp_complete_known_hosts fping6[/code\]

https://redd.it/1m6phvu
@r_bash
How do you handle secrets in Bash when external tools aren't an option?

In restricted environments (no Vault, no Secrets Manager, no GPG), what's your go-to method for managing secrets securely in Bash? E.g local noscripts, CI jobs, embedded systems. Curious how others balance security and practicality here.

https://redd.it/1m75h10
@r_bash
Running group of processes parellel, wait till last is finished

I have the following problem and the following bash noscript. I need to execute the command on ln 1, wait and then execute the commands on ln3 and 4 parallel. After finishing those the command on ln 5, wait and then the commands on ln6 and 6 in paralelle:

[1] php -f getCommands.php
[2] [ -f /tmp/download.txt ] && parallel -j4 --ungroup :::: /tmp/download.txt
[3] [ -f /tmp/update.txt ] && parallel -j4 --ungroup :::: /tmp/update.txt
[4]
[5] php -f getSecondSetOfCommands.php
[6] [ -f /tmp/download2.txt ] && parallel -j4 --ungroup :::: /tmp/download2.txt
[7] [ -f /tmp/update2.txt ] && parallel -j4 --ungroup :::: /tmp/update2.txt

Without success, i tried the following:

put an & after line 2,3,6 and 7, this will start the command on line 5 prematurely.

Brackets, no effect:

php -f getCommands.php
{
[ -f /tmp/download.txt ] && parallel -j4 --ungroup :::: /tmp/download.txt
[ -f /tmp/update.txt ] && parallel -j4 --ungroup :::: /tmp/update.txt
} &

writing the parallel commands in two different txt files and call them with parallel, but this just makes the noscript so much less maintanable for such a simple problem.

Anyone has some good pointers?

https://redd.it/1m7fbcr
@r_bash
I have created a (subnoscript) translator for YouTube videos using only bash.

Why?

For some reason, YouTube's automatic translator hasn't been working for me, and the translation quality is usually not good. Anyway, this transcribes using Whisper-1 and translates using OpenAI's GPT.

What does the noscript do?

* It downloads the video
* Creates an ogg audio (ogg allows trannoscription of long videos due to its small size)
* Transcribes the audio with Whisper
* Simultaneously translates the subnoscript file (.srt) based on a Chunk\_Size
* Merges the new translation with the video, creating an MKV

How to use?

`this_noscript_file youtube_url [output_dir]`

*Note: I really didn't write this for anything beyond personal use, so don't expect anything stable or user-focused. I'm just sharing it in case it helps someone and they want to take a look at the noscript. If anyone wants to improve it, I will gladly accept any PR.*

*kinda 100 lines of bash code*
[https://gist.github.com/kelvinauta/0561842fc9a7e138cd166c42fdd5f4bc](https://gist.github.com/kelvinauta/0561842fc9a7e138cd166c42fdd5f4bc)


https://redd.it/1m7rold
@r_bash
Building A Privacy-First Terminal History Tool

After losing commands too many times due to bash history conflicts, I started researching what's available. The landscape is... messy.

The Current State:

Bash history still fights with itself across multiple sessions
Atuin is great, but it sends your commands to their servers (raising privacy concerns?)
McFly is looking for maintainers (uncertain future)
Everyone's solving 80% of the problem, but with different trade-offs

What I'm Building: CommandChronicles focuses on local-first privacy with the rich features you want. Your command history stays on your machine, syncs seamlessly across your sessions, and includes a fuzzy search that works.

The goal isn't to reinvent everything - it's to combine the reliability people want from modern tools with the privacy and control of local storage.

Question for the community: What's your biggest pain point with terminal history? Are you sticking with basic bash history, or have you found something that works well for your workflow?

Currently in early development, but would love to hear what features matter most to developers who've been burned by history loss before.

https://redd.it/1m7wmmm
@r_bash
🚀 Auto Install Docker, Portainer, Caddy & n8n — with One Bash Script!
https://redd.it/1m7z4y1
@r_bash
I expected 55 but I got 0+1+2+...

bash-3.2$ total=0

bash-3.2$ for i in {1..10};

\> do

\> total=$total+$i

\> done




bash-3.2$ echo $total

0+1+2+3+4+5+6+7+8+9+10

https://redd.it/1m7rz71
@r_bash
I built a GTK-based Bash Script Manager in C#/.NET, run and manage your bash noscripts with a simple GUI

i built an bash noscript manager if anyones interested

https://github.com/Samoreilly/BashScriptManager

https://redd.it/1m84mxd
@r_bash
Simple question about # shellcheck source=/path

Hi,
I have started using shellcheck today in VS Code using the Bash IDE extension, and my beginners' question is: how to make it recognize functions defined in another file without actually 'sourcing' the file? The problem is, shellcheck can't understand that I'm using a non-conventional function for sourcing the file which itself is defined somewhere else. Let's say that's called mysource. So I'm doing

# shellcheck source=../utils/myfunctions.bash
mysource myfunctions # let's just assume this sources the myfunctions.bash after preparing the correct file path.

The problem is, shellcheck is adamant on not recognizing (/auto-completing etc.) unless I use the official "source" or "." for the file with its full path. What's even the point of the comment if I really have to do that? If I really had to give the full path of the file with "source" or ".", then it works regardless of my writing the shellcheck source directive or not. I have also created the ~/.shellcheckrc file and placed external-sources=true in that. I have even reproduced this problem in a very small sample folder with just two files in the same directory. Without officially sourcing it doesn't want to recognize the functions... How to fix that?

https://redd.it/1m916h3
@r_bash
Built Blade — A Clean Bash Tool to Download YouTube Videos from Terminal (No Ads, No GUI)
https://redd.it/1m91wto
@r_bash
Ghostty terminal not opening new tabs in same directory — Bash + Starship issue?

I’m using Ghostty terminal on macOS with the Starship prompt and Bash. In most other terminals (like iTerm2 or Alacritty), when I open a new tab, it starts in the same working directory as the previous one. But in Ghostty, new tabs always start in my home directory, even though Ghostty is supposed to support OSC 9;9 to inherit the working directory. I’ve set PROMPT_COMMAND='printf "\\e\]9;9;%s\\a" "$PWD"; starship_precmd' at the end of my .bashrc, and verified it’s there by checking echo "$PROMPT_COMMAND". I’ve also tried disabling Starship entirely and just using the Ghostty escape sequence on its own, but new tabs still open in \~. I’m on the latest version of Ghostty (via Homebrew). Manually running the escape sequence doesn’t seem to help either. Has anyone gotten directory tracking to work properly in Ghostty with Bash and/or Starship?

https://redd.it/1m8b2s7
@r_bash
I made a noscript that lets you play YouTube directly from your terminal

https://github.com/yatharthgeek/yt-play
This is the noscript and I want you guys to review it make it a little better cause it's super ugly and basic and sometimes fails.

https://redd.it/1maoh8e
@r_bash
'\r': command not found

Hello group, I am sure this is a total newbie to bash question, but I tried adding logging to a simple rclone backup noscript and I do not understand the error, because there is no "\\r" in the noscript. The rclone synch runs successfully.

The noscript:

#!/bin/bash

LOG_FILE="/var/log/backup.log"

log() {

echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> "${LOG_FILE}"

}

log "Starting the noscript"

rclone sync -v --create-empty-src-dirs /$HOME/Documents Google:Documents

log "Script completed successfully"

Result including cat to verify the noscript run:

>barry@barryubuntu:\~/sh$ sudo bash backup.sh

>[sudo\] password for barry:

>backup.sh: line 3: $'\\r': command not found

>backup.sh: line 4: syntax error near unexpected token `$'{\\r''

>'ackup.sh: line 4: `log() {

>barry@barryubuntu:\~/sh$ cat backup.sh

>\#!/bin/bash

>LOG_FILE="/var/log/backup.log"

>log() {

>echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" >> "${LOG_FILE}"

>}

>log "Starting the noscript"

>rclone sync -v --create-empty-src-dirs /$HOME/Documents Google:Documents

>log "Script completed successfully"

>

As I said the rclone synch is working, I am just trying to get backup to Google drive like I had in Windows before switching to Ubuntu a few months ago. But logging sure would be an easier way to make sure it is functioning. This logging piece I simply copied from a lesson in bash noscript logging. Thanks all.



https://redd.it/1maxlgw
@r_bash
Need help making a noscript for file decoding

So I’m not good at coding whatsoever. But I’m trying to streamline the process of decoding a non-compatible surround audio file to a .wav file with dolby reference player. Asked chat gpt but the ponctuation is so damn confusing. The commands for this process are:

drp “input file path” --ac4dec-dmx-mode hp --ac4dec-drc-enabled false --ac4dec-out-ref-level 0 --ac4dec-limiter-enabled false --ac4dec-pres-index 1 --audio-out-file ‘input file name’.wav

Could yall please help me figure out how do I make a noscript so that I’ll just have to input the .ac4 file and let it do its thing? Appreciate yall in advance. Sorry for the formating, posting on a phone.

https://redd.it/1mbb23k
@r_bash
Question about Docker usage in a bash noscript

Hey, im a total beginner to bash noscripting, so sorry for potentially noob question. Recently I decided to write a simple noscript for automatically converting and sending ebooks to my e-reader using Calibre's utilities. It also utilizes secret-tool for safely storing mail credentials.

In such a scenario, would it be better to demand users to install Calibre locally, or containerize my noscript via Docker? The second option seems a bit excessive for a noscript consisting of two small files but I'm not sure what are the standard solutions in such scenarios. Also it's my first time using Docker so I'm a bit lost.

Thanks in advance!

https://redd.it/1mbre2x
@r_bash
Question about Docker usage in a bash noscript

Hey, im a total beginner to bash noscripting, so sorry for potentially noob question. Recently I decided to write a simple noscript for automatically converting and sending ebooks to my e-reader using Calibre's utilities. It also utilizes secret-tool for safely storing mail credentials.

In such a scenario, would it be better to demand users to install Calibre locally, or containerize my noscript via Docker? The second option seems a bit excessive for a noscript consisting of two small files but I'm not sure what are the standard solutions in such scenarios. Also it's my first time using Docker so I'm a bit lost.

Heres the noscript for anyone interested (it might not currently work on your machine, hence this post): https://github.com/Dewaszmi/send-to-kindle-noscript

https://redd.it/1mbmnf1
@r_bash
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