|
FlapYoJacks posted:literally every single embedded Linux system I have ever worked on since 2005 has had tab completion. how nice for you
|
# ? Apr 8, 2022 21:13 |
|
|
# ? May 23, 2024 15:48 |
|
Poopernickel posted:aliases are a workaround for lovely defaults, and tab-completion isn't all that common on the embedded Linux stuff that I have to janitor eh idk i like the idea of single-letter commands being available for me to use as aliases alias l=journalctl or smth
|
# ? Apr 8, 2022 21:15 |
|
are there really people who have to use kubectl on a regular basis who don't immediately alias it to k
|
# ? Apr 8, 2022 21:20 |
|
Poopernickel posted:how nice for you Ash supports tab completion. What shell are you using?
|
# ? Apr 8, 2022 21:25 |
|
FlapYoJacks posted:Ash supports tab completion. What shell are you using? probably busybox but if you're regularly doing cli janitor work on a system with only busybox, you done hosed up and landed yourself in one of three situations 1) you're working on an embedded device so incompetently designed by someone else that it doesn't expose sane configuration and debugging interfaces 2) you've designed an embedded device so incompetently that it doesn't expose sane configuration and debugging interfaces 3) you're working on an embedded device you don't actually understand how to configure or debug, so you figure you can use your server janitor skills to hack it into submission if you're on a busybox system and find yourself running journalctl or kubectl, you're probably in situation three
|
# ? Apr 8, 2022 22:00 |
|
Ash is the shell Busybox provides, which supports tab completion.
|
# ? Apr 8, 2022 23:54 |
|
speaking of tab completion, modern bash (though I don't know how modern since I stopped paying attention to linux for more than a decade until last year) has some magical tab completion that is aware of switches and arguments of various commands and can autocomplete those for instance, I have a file text indexer, recoll, running on my document repository as a service, and I have a systemd unit file for it called recoll.service placed in /etc/systemd/system. If I want to stop it, I can type systemctl stop rec<tab> and it autocompletes the filename, even if I'm not currently in /etc/systemd/system where the unit file is located - it's aware of where the unit files are and that this is the argument where I'd be entering a unit file filename again I don't know how new and impressive that is but I thought it was pretty cool when I found it
|
# ? Apr 9, 2022 00:31 |
|
Sapozhnik posted:are there really people who have to use kubectl on a regular basis who don't immediately alias it to k it comes pre-aliased out of the box for me as oc
|
# ? Apr 9, 2022 03:09 |
|
I have the full length command so that when I write doc I never accidentally rely on undocumented local config
|
# ? Apr 9, 2022 04:57 |
|
BattleMaster posted:speaking of tab completion, modern bash (though I don't know how modern since I stopped paying attention to linux for more than a decade until last year) has some magical tab completion that is aware of switches and arguments of various commands and can autocomplete those Unsurprisingly it's all rigged up using horrific shell scripts https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html
|
# ? Apr 9, 2022 05:24 |
|
BattleMaster posted:speaking of tab completion, modern bash (though I don't know how modern since I stopped paying attention to linux for more than a decade until last year) has some magical tab completion that is aware of switches and arguments of various commands and can autocomplete those It's actually not part of bash. Tab completion scripts are almost always packaged separately and aren't part of Bash at all. Bash knows how to execute an entry script function in response to a tab, and that's it. The rest is all external. There's a standard bash-completion package on most distros. Systemd's completion scripts are managed separately. They're an optional component when building systemd from source. Poopernickel fucked around with this message at 08:06 on Apr 9, 2022 |
# ? Apr 9, 2022 06:08 |
|
I'm ok with tab completion but I don't use aliases because I write a lot of documentation and it's easier to dump history if I need to document stuff. My typing speed is fast enough and auto complete helps enough that aliases aren't worth the effort. Also, modern tab completion sometimes doesn't let you tab-complete files for certain programs depending on what's going on and I have to then copy and paste a long rear end filename because I'm tired of typing out some long thing to get an error later.
|
# ? Apr 9, 2022 06:12 |
|
I have to admit, systemd init files are pretty good.
|
# ? Apr 9, 2022 06:13 |
|
speaking of kubectl and tab completion heres the part of my bashrc that sets up tab completion for "k" as an alias for kubectl, or tells me what to run if the kubectl tab completion config is missing:code:
|
# ? Apr 9, 2022 08:22 |
|
Poopernickel posted:aliases are a workaround for lovely defaults, and tab-completion isn't all that common on the embedded Linux stuff that I have to janitor why not? remember even an original raspberry pi is about 7x the performance of a circa-1995 SPARCstation 20, and that was a fast system compared to the mainframes, minis, and workstations of the 70s and 80s on which tab completion was developed I’ve used tab completion on a Sun-3/60 and an HP 9000-340, each with a 16MHz 68020 and 16MB of RAM, and on each it was tolerable, while on a 25MHz 68040 with 32MB of RAM it was perfectly usable—and all of those were netbooted with root and swap on NFS
|
# ? Apr 9, 2022 08:42 |
|
Rufus Ping posted:Unsurprisingly it's all rigged up using horrific shell scripts https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion.html yeah heaven forbid there be a well-defined mechanism for specifying commands and their parameters and arguments, especially in a way that integrates with a systemwide help mechanism
|
# ? Apr 9, 2022 08:49 |
|
eschaton posted:why not? it's not a performance thing - just not something I see included in people's designs very often. Maybe because the bash-completion packages in Buildroot and Yocto both depend on Bash, and Bash is hard to ship in consumer goods because it's GPLv3. The "unmet-but-actually-OK" dependency issue is a problem that can be solved by an engineer who cares to do it. Most folks don't though, at least not at any of the places where I've done embedded Linux work. So the result is that bash-completion is rarely included.
|
# ? Apr 9, 2022 09:03 |
FlapYoJacks posted:Ash supports tab completion. What shell are you using? FlapYoJacks posted:Ash is the shell Busybox provides, which supports tab completion.
|
|
# ? Apr 9, 2022 11:41 |
|
BlankSystemDaemon posted:Does busybox use some other Almquist shell than the BSDs? Because command completion based on $PATH has only worked as of recently. there's a "debian almquist shell" (dash) that I know a number of linux-adjacent OSes use because it's both a fairly featureful shell and much more portable than bash
|
# ? Apr 9, 2022 12:04 |
|
BlankSystemDaemon posted:Does busybox use some other Almquist shell than the BSDs? Because command completion based on $PATH has only worked as of recently. Busybox uses ash, but it's a version that's maintained in the Busybox tree. Busybox ash has a bunch of hacks that make it look more bash-like, so it's definitely not the same as BSD ash.
|
# ? Apr 9, 2022 12:55 |
|
Kazinsal posted:there's a "debian almquist shell" (dash) that I know a number of linux-adjacent OSes use because it's both a fairly featureful shell and much more portable than bash when ubuntu switched to dash as the default for scripts it threw our product for a loop because they had tons of bashisms in all the shellscripts involved with managing the appserver. and their solution was a config action on install/profile creation that would go through and replace the shabangs with bin/bash on ubuntu only.
|
# ? Apr 9, 2022 15:42 |
|
i've come to like fish's command and file name completion, especially since it will display what the completion would be if invoked right there. unfortunately it doesn't integrate with bash completions.
|
# ? Apr 9, 2022 15:44 |
a command completion system that i can't add things to on the fly because the system is incomprehensible is pointless to me that's why i love tcsh so much, it just uses regular expressions - so if you find a new command you want to add completions for, it's a tiny bit of effort to add it instead of having to work with some completely bonkers syntax that expects you to be a programmer and possibly work in a third language
|
|
# ? Apr 9, 2022 17:44 |
|
regex is incomprehensible
|
# ? Apr 9, 2022 17:59 |
|
Captain Foo posted:regex is incomprehensible nah. i mean, any given regex is incomprehensible, and as a collective thing they are not well understood by anyone, but they are somehow still easy to write.
|
# ? Apr 9, 2022 18:02 |
|
wait do y'all just memorize every hostname you have to SSH into or the stupidly long chain of commands to connect to random containers in k8s or your local docker cluster??? genuinely confused as to why y'all hate aliases like this
|
# ? Apr 9, 2022 19:56 |
|
Lady Radia posted:wait do y'all just memorize every hostname you have to SSH into or the stupidly long chain of commands to connect to random containers in k8s or your local docker cluster??? genuinely confused as to why y'all hate aliases like this
|
# ? Apr 9, 2022 20:21 |
|
but what if they dont use the same private/public keypairs?!?!
|
# ? Apr 9, 2022 20:24 |
|
Lady Radia posted:wait do y'all just memorize every hostname you have to SSH into or the stupidly long chain of commands to connect to random containers in k8s or your local docker cluster??? genuinely confused as to why y'all hate aliases like this yes
|
# ? Apr 9, 2022 20:24 |
Lady Radia posted:wait do y'all just memorize every hostname you have to SSH into or the stupidly long chain of commands to connect to random containers in k8s or your local docker cluster??? genuinely confused as to why y'all hate aliases like this pre:if ( -r "$HOME/.ssh/known_hosts" ) then set hosts = ($hosts `cut -w -f1 "$HOME/.ssh/known_hosts" | cut -d, -f1`) endif complete ssh 'p/1/$hosts/' \ 'c/-/(l n)/' \ 'n/-l/u/ N/-l/c/ n/-/c/ p/2/c/ p/*/f/' complete scp "c,*:/,F:/," \ "c,*:,F:$HOME," \ 'c/*@/$hosts/:/'
|
|
# ? Apr 9, 2022 20:49 |
|
oh my god. just loving. write a quick alias. it takes half a second to loving copy paste the command, write "echo alias buildmacssh=pasted_command >> .zshrc", and be done with it. ahhh
|
# ? Apr 9, 2022 20:57 |
|
Lady Radia posted:but what if they dont use the same private/public keypairs?!?! you can specify the private key you want to use in your ~/.ssh/config file
|
# ? Apr 9, 2022 21:02 |
|
im so unreasonably upset right now.
|
# ? Apr 9, 2022 21:03 |
sb hermit posted:you can specify the private key you want to use in your ~/.ssh/config file When I discovered this I literally spent about 5 minutes logging in and out of my server via ssh giddily.
|
|
# ? Apr 9, 2022 21:21 |
Lady Radia posted:oh my god. just loving. write a quick alias. it takes half a second to loving copy paste the command, write "echo alias buildmacssh=pasted_command >> .zshrc", and be done with it. ahhh sb hermit posted:you can specify the private key you want to use in your ~/.ssh/config file BlankSystemDaemon fucked around with this message at 22:11 on Apr 9, 2022 |
|
# ? Apr 9, 2022 22:09 |
|
BlankSystemDaemon posted:.tcshrc excuse me
|
# ? Apr 9, 2022 22:21 |
|
more like fsh, because it's fail
|
# ? Apr 9, 2022 22:22 |
|
BlankSystemDaemon posted:how short is your .ssh/known_hosts, op???
|
# ? Apr 9, 2022 22:23 |
|
I mean aliases are great but why would you use them for ssh'ing to boxes lol
|
# ? Apr 9, 2022 22:47 |
|
|
# ? May 23, 2024 15:48 |
AnimeIsTrash posted:excuse me Lady Radia posted:it's single digits most of the time because i dont custodian the servers the clusters live on, op. Mr. Crow posted:I mean aliases are great but why would you use them for ssh'ing to boxes lol
|
|
# ? Apr 9, 2022 22:56 |