I feel like I'm getting better at shell fu.
-
I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.
@gsuberland in zsh, it's all one page, zshbuiltins(1)
-
I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.
@gsuberland not on their own; bash builtins share one giant manpage you never want when you get it, and never when you want it. man test.
zsh has `man zshbuiltins`. -
@gsuberland smartctl has a json output option, which would mean jq could give something maybe more readable, but the format it emits is kinda annoying... it's like tables as json
@classabbyamp yeah you could do
smartctl -a -j /dev/da0 | jq '.ata_smart_attributes.table[] | select(.name=="Power_On_Hours") | .raw.value'
but the grep and cut was shorter here
-
@gsuberland in zsh, it's all one page, zshbuiltins(1)
@classabbyamp what a mess
-
@gsuberland not on their own; bash builtins share one giant manpage you never want when you get it, and never when you want it. man test.
zsh has `man zshbuiltins`.@funkylab which then makes it impossible to search >_<
-
@funkylab which then makes it impossible to search >_<
@gsuberland yep, exaxtly my gripe. `man zsh-for` or even `man zsh for` would be possible on modern `man`s
-
@acsawdey I've tried to use awk a few times but I find the syntax non-obvious (in a similar way to perl) so it never sticks
honestly `python -c` would probably be easier for me to remember lol
@acsawdey @gsuberland
Awk is a bit awkward, but it's a piece of cake compared to Perl. But I, too, prefer Python. -
@acsawdey @gsuberland
Awk is a bit awkward, but it's a piece of cake compared to Perl. But I, too, prefer Python.@brouhaha @gsuberland well, yes for anything other than 1-liners I too prefer python. But awk somehow is very amenable to doing tiny things like this:
awk '{count[$0]++} END{for(x in count) { printf("%-10d %s\n",count[x],x) } } ' | sort -n
-
I also hate that shell builtins don't have manpages. I have looked up the justification for this and I find it deeply unsatisfying.
@gsuberland consider toybox?
-
the main annoyance I have with shell stuff is how the command names defy discoverability.
"I would like to flush my current shell history to the history file"
"ok run fc -W"
"huh. what does fc stand for?"
"fix command"
"... ok"
I use fc (through aliases) all the time and I have never heard a good explanation of the name.
100% agreed discoverability is a huge problem in shell commands, built-in or not. I wrote a tool, "nums",then literally years later found out that "seq" does almost the same thing. Mine is only better in being smart about zero padding: "nums 01-10" pads, "nums 1-10" doesn't
-
R ActivityRelay shared this topic