Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

7
  • 4
    AFAIK the unquoted expansion $raidCommand performs word splitting and globbing, but doesn't magically perform redirections - so > , /dev/null, and 2>&1 are all passed to mdadm as additional arguments Commented Jul 21, 2024 at 15:29
  • 1
    ... see for example Passing a command with arguments and redirection to a function or How to use output redirection dynamically? Commented Jul 21, 2024 at 15:35
  • 1
    What's with all the trailing \ characters? Commented Jul 21, 2024 at 18:25
  • 2
    "It actually mutes all output of mdadm - except the error you see in this example" – I think the tool reports the fatal error and does nothing more; so "all the output except" is not muted, it's not there in the first place. Commented Jul 21, 2024 at 20:37
  • 1
    Side note: there are better (or at least less cumbersome) ways to be able to "copy&paste to bash directly": bracketed paste, grouping commands ({ … }), edit-and-execute-command (Ctrl+x, Ctrl+e) or even putting everything in a shell function and calling it. Commented Jul 21, 2024 at 20:50