Holy crap! That 50 line #ShellScript, which includes child process management and signal handling, not only works, but #shellcheck only whines about two things, both of which I know don't matter.
Holy crap! That 50 line #ShellScript, which includes child process management and signal handling, not only works, but #shellcheck only whines about two things, both of which I know don't matter.
Shell script that's using curl and jq to get the list of channels from @somafm, fzf to allow you to select one, and mpv to play it.
Is there any other way to break up a single string of combined options as individual options other than setting “$@“ (breaking up the string on white space), as in …
set -- $option_list
command $@ …
… ? The command is “rsync(1)” in this case if that matters.
An oddity I noticed in that script is that it uses “Bourne Again Shell”, #bash, but is not using array to collect, pass the options around. How would that be done there?
Script where you think. Emacs + shell = zero-distance hacking. No tabs, no noise. Just flow.
#Emacs #Linux #ShellScript #Productivity #DeadSwitch
http://tomsitcafe.com/2025/05/11/shell-scripts-in-emacs-the-cyber-ghosts-shortcut-to-flow/
Hola a todos. Si eres de aquellos que ya usan #Vim o quieren aprender a usarlo y necesitan algo rapido y funcional, te dejo aquí un #ShellScript para que te puedas descargar todo sin muchas vueltas. El #script está enfocado en usuarios de #Debian. Puedes consultar el código en mi repositorio de codeberg :)
Comando -> curl -fsS https://codeberg.org/manjo/VimUltimateShellScript/raw/branch/main/UltimateVim.sh | sh
Cada día más cerca de reemplazar a Excel 🥹
You don’t know how many personalities the #AWS #CLI has until you double-check your #disasterrecovery vendor’s work during a failover test. But hey, at least now I have a pile of #shellscript that gives me strong signals.
That’s all well and good for the #infrastructure, but we may have impeded ourselves when we gave the unproven disaster recovery environment production-like (i.e. restrictive) permissions. Diagnosing why the workloads aren’t starting up properly is unnecessarily difficult.
Bash variables: A subshell cannot write back variables to its parent shell.
I want to get a variable AA back anyway and tried:
1. in the subshell: declare -p AA >./tmp/somefile
2. in the parent shell: source ./tmp/somefile
Can this fail? Well (2) is run in a function, so the 'declare ...' we source only declares a local variable. As soon as leaving the function, the AA is gone.
There does not seem to be a version of 'declare -p' which adds "-g" to the output.
【CloudFlare】動的IPアドレスをAPIで自動更新する。DDNS #ShellScript - Qiita
💡 Struggling with shell script arguments? Our guide breaks down positional parameters step by step! From $0 to ${10}, we've got you covered with practical examples.
Read: Mastering Positional Parameters in Linux at: https://www.spsanderson.com/steveondata/posts/2025-04-18/
💡 Struggling with shell script arguments? Our guide breaks down positional parameters step by step! From $0 to ${10}, we've got you covered with practical examples.
Read: Mastering Positional Parameters in Linux at: https://www.spsanderson.com/steveondata/posts/2025-04-18/
How To Replace Text In Multiple Files Using A Bash Script In Linux #Bash #ShellScript #Linux #Linuxcommands #Linuxhowto #Linuxbasics
https://ostechnix.com/replace-text-in-multiple-files-using-bash-script/
@jutty I sometimes *do* enjoy writing #shellscript. Kind of similar to how I sometimes even enjoy writing #Javascript.
First of all, I think the only sane way to write shell scripts is to aim for strict #POSIX compliance. Sure, if you write "internal" scripts for some OS or distribution, it's fine to target specifically the shell coming with that system, but that's a special case. For everything else, if your script has an extra dependency on a specific shell, it would most likely make more sense to use a more powerful language with possibly a *different* runtime dependency.
That said, sure, you will use an "obscure" language. The trick is: Think about the right tool for the job upfront. The #shell can be very powerful for a certain class of problems, e.g. as an orchestration layer for separate tools offering "shell-friendly" interfaces like flexible commandline arguments and a stdin/stdout format that's easy to parse for a shell script.
Here's my latest non-trivial work in shellscript and I'd use shellscript again for the same job:
https://github.com/Zirias/dos2ansi/blob/master/src/bin/showansi/showansi.in.tmpl
In a nutshell, it orchestrates xterm, less and my own dos2ansi tool to build an ansi-art viewer. It might be a bit "borderline" because it contains obscure functions to parse some string character by character (something a shell can't do in a sane way), but I think that was a fair price for avoiding to depend on some other interpreter, it's still a relatively short script.
Gotta say, I wish #bash had local
/ lexically-scoped functions, rather than having to rely on hacks like:
function widget {
function ___widget_parse {
...
}
...
unset ___widget_parse
}
Something like this (which does not currently work) would be lovely:
function widget {
local function parse {
...
}
}
Bashing Out A Simple Battery Status Script In Bash
https://eggflix.foolbazar.eu/videos/watch/4bd22c77-42ea-4d69-92cf-c486d63158fb
新しい curl コマンドの使い方 完全ガイド(2025年版) #ShellScript - Qiita https://qiita.com/ko1nksm/items/30982a5f357f26ae166f
My secret weapon for #AudioEditing / #SoundDesign = #FFMPEG + #ChatGPT (other LLM’s are probably fine for this too). What can you do with it? An endless amount of batch editing and conversion tasks (also incl. #VideoEditing !); generate a large amount of variations on a sound (based on for example a folder full of samples + audio analysis and transformation); recursive/#fractal like creativity. This often involves generating a combination of an FFMPEG terminal command + .sh #ShellScript.