mastodon.ie is one of the many independent Mastodon servers you can use to participate in the fediverse.
Irish Mastodon - run from Ireland, we welcome all who respect the community rules and members.

Administered by:

Server stats:

1.7K
active users

#bash

16 posts15 participants1 post today

Can we please have one standard way to define shell completions, that is compatible with all shells?

I'm moving from zsh to nushell, and it's relatively new, and you have to configure completions by writing a lot of code, including a lot of files, it's a nightmare.

It's easier for older shells like zsh or fish only because other people already done it, and some packages include per-shell completions.

There is @carapace_sh which attempts to do the right thing, but having completions in the other place than actual app is not very good idea.

usage.jdx.dev/ is trying to do the same but differently, and it has a way for an app to provide a schema for completions. This is step in the right direction, but not many tools support this.

Has anyone tried to put this somehow on the shell level? E.q. app includes a file like `myapp.completions` , and shell have a module which reads the file and generates a list of completions based on user input.

The right way to do this, is probably by defining a standard cross-platform/cross-shell schema. And it can be read by the shell, or by the tool like carapace or usage...

usage.jdx.devUsageSchema for CLIs
#Linux#zsh#bash

I was looking for an alternative to classic shell scripts, so I timed a Hello World program in different languages for fun. I thought you might want to know:

1 ms - #Bash
1 ms - #Perl
12 ms - #Python
33 ms - #Go (shebang calling `go run`)
38 ms - #C (shebang compiling to temporary file)
61 ms - #Rust (shebang compiling to temporary file)

Needless to say that this is a highly unfair and silly comparison. It's still interesting, though.

#bash alias we should all have:

alias pku="pkill '(steam|zoom)'"

or if you're fancy and want to have a file of usual suspects,

> alias pku="pkill \(\`tr $'\n' $'\x7C' <usual-suspects.txt |head -c-1\`\)"

so then when you run it
> (set -x; pku;)

it does
++ tr '
' '|'
++ head -c-1
+ pkill '(steam|zoom)'

because the usual-suspects.txt file is just

steam
zoom

Треба було розпарсити інформацію з виводу команди dmidecode, і знайшов утиліту jc, яка зручно конвертує вивід в json, який в парі з jq можна далі зручно парсити. Повний список програм, з якими працює jc, є в readme на сайті проєкту.

$ jc dig example.com | jq -r '.[].answer[] | [.name,.class,.type,.ttl,.data] | @tsv'
example.com.	IN	A	224	23.192.228.80
example.com.	IN	A	224	23.192.228.84
example.com.	IN	A	224	96.7.128.198
example.com.	IN	A	224	23.215.0.136
example.com.	IN	A	224	96.7.128.175
example.com.	IN	A	224	23.215.0.138
$ jc dig -t NS example.com | jq -r '.[].answer[] | [.name,.class,.type,.ttl,.data] | @tsv'
example.com.	IN	NS	15103	a.iana-servers.net.
example.com.	IN	NS	15103	b.iana-servers.net.
#bash#jc#jq

Build thumbnails with the same basename from a directory of video files using ffmpegthumbnailer and #Bash #C0

for oldfile in *.mp4; do
filename=${oldfile%.*}
ffmpegthumbnailer -i "$filename.mp4" -o "$filename.jpg"
done

Linus Torvalds has proper motivated reasons for really disliking file systems without a case sensitivity.

Read this with me from the kernel lkml, regarding bcachefs.

Re: [GIT PULL] bcachefs fixes for 6.15-rc4 - Linus Torvalds
lore.kernel.org/lkml/CAHk-=wja

🖋️ #bash #sh #zsh #ksh #csh #tcsh #fish #git #Linux #lkml #POSIX #FOSS #100daysofCode #640DaysOfCode #coding #1024DaysOfCode #github #programming #Torvalds #filesystem

lore.kernel.orgMaking sure you're not a bot!

Cute little script is cool! I wrote a little bash script to wrap around a thesaurus .txt file I found in a unix stack exchange answer (link in script).

It started out as a one-liner, but I adapted it after the results were not completely terrible, though I'm always looking for better ones.

Why are all thesauruses (thesauri? thesauruseseseses?) online and why aren't there any decent local offerings for linux?

Either way, enjoy this little standalone bash script - I'm p proud of the ranking algorithm implementation in the big piped one-liner bit at the end.

gitlab.com/sbrl/bin/-/raw/mast

Been doing good shit lately - building clustered server stacks for some of the world's greatest corporations.

I've been doing Bash programming for over 20 years, long before Puppet and Ansible came along, so I never really got into those technologies. I gave them a chance, but I prefer having full control, access to sources, and flexibility in my work. That's why I'm not a fan of the previously mentioned tools - or things like Tailwind and Docker. I love building my own tools and frameworks.

Replied in thread

@mff @nixCraft

@mff @nixCraft

'vim'

without any file name is all you need to type in your Bash to see the welcome screen of vim.
Bram Molenaar who created vim on the Commodore Amiga, even tells how you can support Children in Uganda, if you bother to read the help file in its initial headers. The information was updated, for as far as I know, until his departure of life.

I'm currently on mobile otherwise I would have put up in a screenshot