New comment by foopub on void-packages repository https://github.com/void-linux/void-packages/issues/13024#issuecomment-772661674 Comment: > Herewith, a couple of observations: > > * The write error is not from `stat`, `tr` or anything like that. It's the kernel rejecting the values you're trying to write to `/sys/power/resume`. > > * The output of the `ls` scrape is _not_ the same as that from `stat`. `ls` prints device types in decimal, but `stat` prints hex values: > > > ``` > % ls -lH /dev/watchdog > crw------- 1 root root 10, 130 Jan 25 23:43 /dev/watchdog > > % stat /dev/watchdog -c '%t:%T' > a:82 > ``` > > * Sometimes these sysfs writes are finicky, and a terminating newline can cause a problem. In the original `ls` scrape, you can try `echo -n` to suppress the new line. In the `stat` version, you can use `tr -d '\n'`. Aight, good points! It seems the kernel won't accept wrong values in the correct format either. Running `stat $resume -c %t:%T | tr -d '\n'` inside the script actually prints 0:0 (instead of 8:3 which is my swap file) and is also rejected. Perhaps the stem of the issue is $resume pointing to the wrong thing? Edit: nvm, $resume seems to be pointing to a link - using `stat $resume -Lc %t:%T | tr -d '\n'` is fine