Skip to main content
8 events
when toggle format what by license comment
Apr 11 at 2:00 comment added aggregate1166877 @gioele Your suggestion indeed works on my system. I personally dislike complex regex for this kind of answer though because it prevents newcomers from meaningfully altering it. My approach allows people to easily chain in additional commands based on preference. There's also the issue that regex is fragile and can have hard-to-fix edge cases that aren't immediately obvious.
Apr 10 at 8:06 comment added gioele The ls/while read/awk part can be replaced with a single grep invocation: grep -Po '^(?=( +\d+){9})( +\d+)' /sys/block/*/stat.
Jul 12, 2024 at 22:38 comment added aggregate1166877 @einpoklum The point of a function is to save it in some initialization script such as /etc/bash.bashrc or ~/.profile. That way, you don't need to copy-paste this into your terminal every time you need it. You save the function once, and then whenever you run watchSync it'll just work™. In Bash et al. a function actually just means "custom command that isn't an application."
Jul 12, 2024 at 19:44 comment added einpoklum Why make it a function, rather than just executing the contents of the function?
S Nov 26, 2022 at 18:56 history suggested Donatzsky CC BY-SA 4.0
Works with bin/sh
Nov 25, 2022 at 13:53 review Suggested edits
S Nov 26, 2022 at 18:56
Aug 16, 2022 at 3:21 history edited aggregate1166877 CC BY-SA 4.0
deleted 1 character in body
Aug 15, 2022 at 7:52 history answered aggregate1166877 CC BY-SA 4.0