For a file in sysfs, I tried using
echo 45>target_size
to set the value to 45. This failed, with an invalid entry. However, if I do:
x=45;echo $x>target_size
it works fine. Further, if I use a very big number, it gives me an error about having an invalid file number. So apparently when you echo a straight number, the terminal is interpreting that as a file descriptor, rather than a literal number. What is the proper way to echo a number?