|
Cybernetic Vermin posted:...how does it fare if the filesystem changes under it as it is running (find after all is not super-clever about it, so what happens if files get doubly reported or fail to get reported at all)... i wonder, what's your solution to this in any os using any language?
|
# ? Nov 1, 2017 16:04 |
|
|
# ? Apr 29, 2024 05:08 |
|
Shell scripts would be fine, it only needs to work once And I'd either deploy it with a Makefile or maybe ansible
|
# ? Nov 1, 2017 17:11 |
|
Shinku ABOOKEN posted:i wonder, what's your solution to this in any os using any language? depends a bit on what the circumstances require, but for example inotify watches to keep track of the piece you are currently working on is a very powerful tool to have available (of course has a command line program as well, but would have to run async and at that point i don't think anyone would defend the resulting shell script). in a context with better error handling (and dealing with signals) i would also be a lot more comfortable simply creating a snapshot to work on or simply going with checking that the structure still agrees after a first pass the key mostly being that you can in principle launch into as powerful tools are you prefer, with the infrastructure required to deal with it. whereas the guy who arrives later and tries to make the shell script do some inotify song and dance is bound to either go insane or break the world should again add that this is all stepping outside the realm the original post was about, but that is sort of the point, a long-living shell script runs the risk of doing such steps
|
# ? Nov 1, 2017 17:54 |
Remember that time Valve used a large shell script and accidentally ran rm -rf / on a bunch of customers' computers?
|
|
# ? Nov 1, 2017 19:05 |
|
I believe it was the Steam startup script in Linux and was performing a Stream client upgrade but the environment variable for the root of the installation path was wrong so oops rm -rf ${STEAM_ROOT}/ became rm -rf /. Deleting directories on Unix is always inherently dubious. I'm sure you can cause a mess with Windows Powershell too though, but developers are unlikely to bundle that as a main executable. MrMoo fucked around with this message at 19:11 on Nov 1, 2017 |
# ? Nov 1, 2017 19:09 |
|
Fucken lol That could happen just as easily in any language though, nothing shell specific about it
|
# ? Nov 1, 2017 20:05 |
|
Poopernickel posted:Fucken lol In most languages, referencing an unknown variable is an error, and not "woops, he must mean the empty string".
|
# ? Nov 1, 2017 20:07 |
|
MrMoo posted:I believe it was the Steam startup script in Linux and was performing a Stream client upgrade but the environment variable for the root of the installation path was wrong so oops rm -rf ${STEAM_ROOT}/ became rm -rf /. The problem was that STEAMROOT="$(cd "${0%/*}" && echo $PWD)" was failing because NTFS-3g is garbage.
|
# ? Nov 1, 2017 20:15 |
Poopernickel posted:Fucken lol Sure it could happen in any language, but it's a lot easier to make a mistake like that in shell scripts because of their unintuitive quoting rules and the way that they keep going by default instead of stopping when running into things which should be an error. It's good that people are starting to wise up to things like shellcheck (to enforce good quoting) and set -euo pipefail, but it'd be even better if they just switched to a more reasonable language for anything that can't fit in a single find / grep / sed / awk / xargs pipeline.
|
|
# ? Nov 1, 2017 20:21 |
|
embedded linux, ship shell scripts eery day eery goddam day
|
# ? Nov 1, 2017 20:53 |
|
Lady Gagas Penis posted:And so it begins. not depicted: emacs user actually enjoying the poo poo
|
# ? Nov 1, 2017 21:05 |
|
Poopernickel posted:embedded linux, ship shell scripts eery day i thought embedded devs gave a poo poo about performance aren't bash scripts even slower than ruby?
|
# ? Nov 1, 2017 23:04 |
|
Condiv posted:i thought embedded devs gave a poo poo about performance one time I replaced hundreds of lines of ksh that took several minutes to run with about 20 lines of perl that did the same thing in milliseconds gently caress shell scripts
|
# ? Nov 1, 2017 23:15 |
|
Condiv posted:i thought embedded devs gave a poo poo about performance ??? no it depends what you're doing and bash is almost a given
|
# ? Nov 1, 2017 23:19 |
|
Soricidus posted:one time I replaced hundreds of lines of ksh that took several minutes to run with about 20 lines of perl that did the same thing in milliseconds
|
# ? Nov 2, 2017 00:08 |
|
Condiv posted:i thought embedded devs gave a poo poo about performance not too common to use bash where speed is concerned, for sure - probably you're gonna ship something with a compiled language (or a plang if you're nasty) but it's super common to use shell scripts in the init system, and anything related to it also it's pretty common to grant single-command sudo privileges to a user so that programs they own can run a shell script that does very specific things like "delete these 12 files and then reboot" Poopernickel fucked around with this message at 00:21 on Nov 2, 2017 |
# ? Nov 2, 2017 00:12 |
|
IMO well-written shell scripts start to fall apart around the 150 line mark, and bad ones around the 10-line mark
|
# ? Nov 2, 2017 00:13 |
|
Condiv posted:i thought embedded devs gave a poo poo about performance busybox has ash but not ruby
|
# ? Nov 2, 2017 00:15 |
|
Soricidus posted:one time I replaced hundreds of lines of ksh your problems: - ksh - hundreds of lines
|
# ? Nov 2, 2017 00:21 |
|
if you're janitoring Makefiles also, those are 95% shell script
|
# ? Nov 2, 2017 00:22 |
|
Poopernickel posted:if you're janitoring Makefiles also, those are 95% shell script lol nice ninja edit
|
# ? Nov 2, 2017 00:30 |
|
Soricidus posted:one time I replaced hundreds of lines of ksh that took several minutes to run with about 20 lines of perl that did the same thing in milliseconds
|
# ? Nov 2, 2017 00:43 |
|
Lady Gagas Penis posted:What were the scripts doing? querying a database, laboriously parsing the textual output via several temporary files, and printing a report. it was a really bad script
|
# ? Nov 2, 2017 10:12 |
|
i don't think anyone should do everything by cli, but many (most?) computer toucher things are done about 3 billion times faster by cli, and cli commands are easily automated. there's an extremely good reason why powershell exists, and no matter how much i hate it because the commands are all too loving long and the auto-complete can be dumb as gently caress at times, it's still vastly better than "open contorl panel, click thing x43, press this, click ok x43" i have a gui on my work laptop for a normal browsing experience and so i can have multiple terminal windows up at the same time effortlessly (screen/tmux can't compare to a decent window management and desktop environment like kde). also, ansible is the better config mgmt system because redhat supplies a library of things like https://github.com/openshift/openshift-ansible which makes my job 99% easier since most community supplied config management poo poo is "task 0: disable selinux" so i'd have to do everything myself anyway. also, i've written shell scripts longer than ~10 lines, but when it's just preparing a working environment or linking files and running commands linearly idc. if you have control flow in your shell script, you've done hosed up tho. incidentally, i have a legacy git server at work which is 100% loving shell scripts and breaks at the tiniest of breezes that i hope to replace by year's end.
|
# ? Nov 2, 2017 10:40 |
|
hobbesmaster posted:busybox has ash but not ruby busybox could probably fit a decent scripting language if it didn't have to carry around the extra bullshit used to make the shell a lovely scripting platform and yes, even ruby is a decent scripting lang compared to bash scripting
|
# ? Nov 2, 2017 10:56 |
|
cli sucks for displaying information a gui can have images descriptions arrows hyperlinks tooltips graphs etc. nothing sucks more than exploring nested data in a cli
|
# ? Nov 2, 2017 13:06 |
|
Shinku ABOOKEN posted:cli sucks for displaying information i think you'll see this graph app i made in ncurses is super good in text mode on my 8k monitor and furthermore
|
# ? Nov 2, 2017 13:28 |
|
Truga posted:i don't think anyone should do everything by cli, but many (most?) computer toucher things are done about 3 billion times faster by cli, and cli commands are easily automated. there's an extremely good reason why powershell exists, and no matter how much i hate it because the commands are all too loving long and the auto-complete can be dumb as gently caress at times, it's still vastly better than "open contorl panel, click thing x43, press this, click ok x43" I've never used screen to replace windowing, but I have used screen a bunch of times to house long running jobs on servers that have a habit of kicking my ssh session thus cutting me off from the stdout of the job.
|
# ? Nov 2, 2017 19:00 |
|
cis autodrag posted:I've never used screen to replace windowing, but I have used screen a bunch of times to house long running jobs on servers that have a habit of kicking my ssh session thus cutting me off from the stdout of the job. tmux is better for windowing anyway
|
# ? Nov 2, 2017 19:08 |
|
Condiv posted:busybox could probably fit a decent scripting language if it didn't have to carry around the extra bullshit used to make the shell a lovely scripting platform take it up with the ieee
|
# ? Nov 2, 2017 22:15 |
|
cis autodrag posted:I've never used screen to replace windowing, but I have used screen a bunch of times to house long running jobs on servers that have a habit of kicking my ssh session thus cutting me off from the stdout of the job. good thing that systemd is “breaking” this! (by forcing the developers of screen, tmux, et al to actually think about what it means to have a disconnected session, and adopting APIs to implement the concept) (which didn’t they refuse to do?)
|
# ? Nov 2, 2017 23:46 |
|
does RMS have thoughts about systemd that could be amusing in a similar way to when someone told him about lldb
|
# ? Nov 2, 2017 23:48 |
|
eschaton posted:good thing that systemd is “breaking” this! the killuserprocesses debacle felt like a really big hammer that nobody outside of systemd wanted
|
# ? Nov 2, 2017 23:56 |
|
hobbesmaster posted:take it up with the ieee maybe i will
|
# ? Nov 3, 2017 00:06 |
|
eschaton posted:does RMS have thoughts about systemd http://forums.debian.net/viewtopic.php?f=20&t=123341 He apparently doesn't actually give a poo poo, since it doesn't violate his 'its free!!!!' poo poo
|
# ? Nov 3, 2017 00:15 |
|
RFC2324 posted:http://forums.debian.net/viewtopic.php?f=20&t=123341 just wait until someone tells him that systemd can manage non-“free” jobs
|
# ? Nov 3, 2017 04:59 |
|
He didn't think well enough of it to mandate its use in GNU's in-house Linux distro. That uses the GNU Shepherd instead, because lol puns Where's the service configuration directory? There's no directory. There's a system declaration! OK, it's not a directory. How do I add a service to it? You write a monadic description in Scheme! Gazpacho fucked around with this message at 07:06 on Nov 3, 2017 |
# ? Nov 3, 2017 06:03 |
|
guix has a service called cuirass. queer rear end. lol
|
# ? Nov 3, 2017 06:19 |
|
RFC2324 posted:http://forums.debian.net/viewtopic.php?f=20&t=123341 yeah, for all his faults at least stallman is pretty consistent. in fact, being excessively consistent is one of his faults he certainly has no particular love of unix as such, it has been clear all along that the choice of cloning unix was a matter of convenience, after his previous attempt to clone the symbolics software
|
# ? Nov 3, 2017 07:09 |
|
|
# ? Apr 29, 2024 05:08 |
|
Gazpacho posted:guix has a service called cuirass. queer rear end. lol Hahahajahahajahahahahajahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahahshahahahahahahahah
|
# ? Nov 3, 2017 18:41 |