#Shellscript

David Cantrell 🏏DrHyde@fosstodon.org
2025-06-03

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.

2025-06-01

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.

codeberg.org/scy/dotfiles/src/

#SomaFM #mpv #fzf #jq #shellscript #dotfiles #webradio

Screenshot of fzf displaying a list of channel titles (Digitalis, Illinois Street Lounge, Secret Agent, Groove Salad, etc.), their IDs (digitalis, illstreet, secretagent, groovesalat, etc.), and their genres (electronic|alternative, lounge, lounge, ambient|electronic, etc.), in different colors.

A text input below the list contains the letters "gr" , and an indication that the list has been narrowed down to 8 of 44 items. The first occurrence of the letter "g" and "r" (in that order) is also highlighted in the list.

To the right is a preview window, saying the following:

Groove Salad (groovesalad)
Genre: ambient|electronic

A nicely chilled plate of ambient/downtempo beats and grooves.

https://api.somafm.com/groovesalad130.pls
Currently 1681 listeners.
Nom__XD, 飲ん,诺穆 (They/Them)🐈‍⬛nomxd
2025-05-30

Ok, some of you are doing too many requests to wttr.in, lol. So here is a way I do it: a singlerequest every time my PC boots. No need for us to do it every time we open a shell, just save the report to a file & read from it. -talk🐾

2025-05-21

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?

#sh #shellScript #bashScript #unix #Linux

DeadSwitch @ T0m's 1T C4feTomsITCafe
2025-05-11

Script where you think. Emacs + shell = zero-distance hacking. No tabs, no noise. Just flow.

tomsitcafe.com/2025/05/11/shel

Tux Dragoon :vim: :debian:anonforrest@infosec.exchange
2025-05-02

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 codeberg.org/manjo/VimUltimate | sh

Un meme de Vim
2025-05-02

Cada día más cerca de reemplazar a Excel 🥹

#ShellScript #SeniorDeveloper

2025-04-29

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.

2025-04-28

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.

#bash #programming #shellscript

2025-04-28

【CloudFlare】動的IPアドレスをAPIで自動更新する。DDNS #ShellScript - Qiita

qiita.com/napspans/items/45510

Steven Sandersonspsanderson@rstats.me
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: spsanderson.com/steveondata/po

#linux #shellscript #Programming #Blog #Technology #CLI

💡 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/

#linux #shellscript #Programming #Blog #Technology #CLI
Steven P. Sanderson II, MPHstevensanderson@mstdn.social
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: spsanderson.com/steveondata/po

#linux #shellscript #Programming #Blog #Technology #CLI

💡 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/

#linux #shellscript #Programming #Blog #Technology #CLI
2025-04-14
I wrote a simple shell script to manage a Slackware chroot environment for building packages.

Tested with Slackware-current. You can create and access the chroot easily with just a few commands.

Source:
https://git.sr.ht/~r1w1s1/slackbuilds/blob/main/chroot-manager.sh

#slackware #shellscript #chroot #Linux
Felix Palmen :freebsd: :c64:zirias@bsd.cafe
2025-03-11

@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:
github.com/Zirias/dos2ansi/blo

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.

R.L. Dane :Debian: :OpenBSD: 🍵 :MiraLovesYou:rl_dane@polymaths.social
2025-03-10

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 {
        ...
    }
}

#ShellScript #ShellScripts #ShellScripting

Joel Carnat 📽️joel@eggflix.foolbazar.eu
2025-03-06
えあい:evirifried::win98_shrimp:🦐Eai@stellaria.network
2025-03-05

新しい curl コマンドの使い方 完全ガイド(2025年版) #ShellScript - Qiita qiita.com/ko1nksm/items/30982a

Rutger Mullerrutgermuller
2025-03-01

My secret weapon for / = + (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. !); 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 .

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst