Remix.run Logo
TheDong 6 hours ago

> 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

If you happen to have moreutils installed, you can do that with pee

    echo $NUM_PAGES | sudo pee 'cat > /proc/sys/vm/nr_hugepages'
direwolf20 4 hours ago | parent [-]

why not write sh -c then?

TheDong 3 hours ago | parent [-]

Because 'sh' isn't in moreutils and is harder to remember, next question.

Why use something portable when you can use cat pee?