Linux: start an mdraid check even though bash's noclobber is set

⚠️
This post was automatically migrated from my old blogging software, and I have not reviewed it for problems yet. Please contact me if you notice any important issues.

A quick post for today. When trying to force my NAS's mdraid array to run a check, in a root terminal, I got this error:

# echo check > /sys/block/md0/md/sync_action
-bash: /sys/block/md0/md/sync_action: cannot overwrite existing file

This is because I have the bash shell on all my servers configured with noclobber enabled, even for the root user's shell, and the file does indeed already exist:

# cat /sys/block/md0/md/sync_action
idle

To overwrite this preexisting file even with noclobber enabled, use the >| operator:

# echo check >| /sys/block/md0/md/sync_action