Readit News logoReadit News

Loading parent story...

Loading comment...

Loading parent story...

Loading comment...

Loading parent story...

Loading comment...

Loading parent story...

Loading comment...

Loading parent story...

Loading comment...

mathfailure commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
ljouhet · 21 hours ago
Most of my aliases contain `--` for the same reason, `git--progress`, `grep--rIn`, `nvidia--kill`, `ollama--restart`, `rsync--cp`, `pdf--nup`...

Easy autocomplete, I know there won't be any collision, and which command is mine.

mathfailure · 16 hours ago
Kinda makes no sense to me: so you don't use '--' as a prefix, you use it in the middle of an alias, so you first have to autocomplete, say, 'gi' not to 'git' but to 'git--progress'. What does that alias do? Doesn't it call git with some args? If so - why not just alias it to git?
mathfailure commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
1vuio0pswjnm7 · 21 hours ago
I use a different prefix character, e.g. "[", but I have been doing this for years

I started using a prefix because I like very short script names that are easy to type

I prefer giving scripts numbers instead of names

Something like "[number"

I use prefixes and suffixes to group related scripts together, e.g., scripts that run other scripts

I have an executable directory like ~/bin but it's not called bin. It contains 100s of short scripts

mathfailure · 16 hours ago
> I prefer giving scripts numbers instead of names

> Something like "[number"

> It contains 100s of short scripts

So you call scripts like [1 [2 [3 [4 ... and remember what each one of them does? If yes - that's nuts, I'd visit a doctor.

mathfailure commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
impoppy · 20 hours ago
Why so many people use ~/bin/? What’s wrong with ~/.local/bin?
mathfailure · 17 hours ago
People tend to want some separation between what's theirs and what's others. Other programs/scripts quite often put something into ~/.local/bin, so it's not yours actually, it's theirs.

Loading parent story...

Loading comment...

mathfailure commented on Start all of your commands with a comma (2009)   rhodesmill.org/brandon/20... · Posted by u/theblazehen
jkercher · 19 hours ago
Tangentially related. Don't ever put "." in your PATH. I used to do this to avoid typing the "./" to execute something in my current directory. BAD IDEA. It can turn a typo into a fork bomb. I took down a production server trying to save typing two characters.
mathfailure · 17 hours ago
I like to follow my own convention where I name files with shell scripts with an extension: .sh for POSIX-compatible scripts, .bash for scripts with bashisms or .zsh for scripts with zshisms.

If I ever wanted to achieve what you initially wanted to achieve - I could use something like

alias -s sh=sh

alias -s bash=bash

alias -s zsh=zsh

Just like I do bind .txt and .conf to 'less', .pdf to 'qpdf', .json to 'ijq', video formats to 'mpv' and so on.

u/mathfailure

KarmaCake day269April 27, 2019View Original