fosstodon.org is one of the many independent Mastodon servers you can use to participate in the fediverse.
Fosstodon is an invite only Mastodon instance that is open to those who are interested in technology; particularly free & open source software. If you wish to join, contact us for an invite.

Administered by:

Server stats:

9.8K
active users

#bash

37 posts33 participants2 posts today

gist.github.com/sjaturner/080c

#bash #commandline

I seem to use the UNIX cut utility more and more as I often need to deal with simple delimited text in pipelines.

My usual MO is to look at the lines coming out of the end of a pipe and just keep guessing the field numbers until I get the result which I want. OK for a small number of fields but it does not scale well. The cutler script takes the first line of any input stream and shows what the cut fields are - I'm hoping that will speed things up for me.

#Linux #Bash #cat

Für alles gibts jetzt einen neuen Sch…
Du sollst Textdateien nicht mehr mit #cat lesen. Weil blablah … ,zu langsam.

Unter cat kann ich mir was vorstellen. Lese alle Zeichen bis EOF
Hier nicht:
Cat ersetzen durch Umleitungsoperator und Kommandosubstitution 😡 😡

test > test.txt
# das ist alt und gammelig !
cat test.txt

# das ist geil und hipp !
# mit Backticks
echo `< test.txt`
#oder so
echo $(< test.txt)

Bin gespannt wann sie das echo wegmachen. Mein Sonntags-Rant

Not sure how other wezterm users handle this, but I have this bash alias in my rc file:

alias tab='wezterm cli set-tab-title'

so that I can just do tab name-of-tab instead of needing to the full command I'll never remember. I then build on this with other aliases like:

  • alias home='tab home-pc && ssh -p2222 me@home-pc'
  • alias cinfra='tab infra && cd ~/projects/infra && git status

These help me keep my terminal clean each time I create a tab to do something completely unrelated to my previous workspace. I have some for authenticating to various cloud providers for my clients as well, so I remember where I'm authed to and what I was doing.

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

Wie schön 🤩
Der #RaspberryPi (zero 2 w) tut jetzt so, wie als wäre er ein USB Stick. Jetzt kann ich die Screenshots von der PS4 auf "einen USB Stick" verschieben und die Bilder landen per oxipng komprimiert und sortiert auf meiner Nextcloud. Es ist so toll, wenn man was funktioniert 🤭

Jetzt muss ich das #Bash Skript noch Error-Sicher machen und dann hoffentlich nie wieder anfassen 😂