top | item 16718781

(no title)

racer-v | 8 years ago

To me the difference between a script and an alias is too trivial to quibble over. I'm fine putting all of my aliases into one-line scripts, if that would really make them easier to manage across systems.

My basic philosophical disagreement is with the idea of avoiding interactive command shortcuts. This essentially limits you to only using command line features you can memorize, or be willing to look them up every single time. There are too many commands, with totally inconsistent argument styles, for this to be practical.

The result is that you're only going to use a small subset of the command line's power if you limit yourself in this way.

RANT: Yes, I agree alias ll="ls -l" is a crutch. But why does 'sort' use -t for separator and -f for field, while 'cut' uses -d and -k? The famously composable Unix tools really aren't very consistent. Radically improved tab completion and documentation (vs man pages and Info) might be a start, but in the end you have to evolve new syntax.

discuss

order

effie|8 years ago

Sort uses -t and -k, cut uses -d and -f. Your point is valid, of course - the options are not consistent across the unix tools.

racer-v|8 years ago

Thank you, I can't even keep track of the option names for long enough to properly curse them. I wonder if there could be a kind of POSIX schema for similar options across utilities, such as

-o fieldseparator=,

-o fieldkeys=2,1,3

which could be used by any program whose capabilities require such a specifier, could be parsed from config files and environment variables, and aliased for reduced verbosity.

cakes|8 years ago

Personally - I write aliases locally that I know I don't need/can live without remotely (e.g. "vi" aliases to "vim" because sometimes I fail to get that "m" on there and I want vim but only on my laptop), I can't imagine writing "system-wide" things as an alias without losing some sleep.

I'd agree with the concept of memorizing it in theory but I'm with you that it becomes a bit too much when the tooling differences in switches from command to command can be even minimally different (something as simple as scp "-P" vs ssh "-p" is easy to forget in the moment). Yeah, I can memorize that example but everything has flags for everything and they can be vastly different (like you mentioned sort vs. cut)