echo $NUM_PAGES | sudo tee /proc/sys/vm/nr_hugepages
I've always found it odd that there isn't a standard command to write stdin to a file that doesn't also write it to stdout. Or that tee doesn't have an option to supress writing to stdout.> write stdin to a file that doesn't also write it to stdout
You mean like "dd of=/path/file" ?
If you happen to have moreutils installed, you can do that with pee
echo $NUM_PAGES | sudo pee 'cat > /proc/sys/vm/nr_hugepages'Why use something portable when you can use cat pee?
And probably `echo -o output-file` as well.
I know it's useful for other things, but it has become a fearful instinct at this point.