by thayne · 9mo ago · 0 comments
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" ?
I know it's useful for other things, but it has become a fearful instinct at this point.
edit: i will be stealing disk destroyer, though
According to Dennis Ritchie, the name is an allusion to the DD statement found in IBM's Job Control Language (JCL), where DD is short for data definition https://en.wikipedia.org/wiki/Dd_%28Unix%29#HistoryAnd probably `echo -o output-file` as well.
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?