zlacker

[parent] [thread] 3 comments
1. TheDon+(OP)[view] [source] 2026-02-05 09:53:40
> 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'
replies(1): >>direwo+Ib
2. direwo+Ib[view] [source] 2026-02-05 11:37:18
>>TheDon+(OP)
why not write sh -c then?
replies(1): >>TheDon+Nh
◧◩
3. TheDon+Nh[view] [source] [discussion] 2026-02-05 12:33:58
>>direwo+Ib
Because 'sh' isn't in moreutils and is harder to remember, next question.

Why use something portable when you can use cat pee?

replies(1): >>semiqu+pY
◧◩◪
4. semiqu+pY[view] [source] [discussion] 2026-02-05 16:45:11
>>TheDon+Nh
Personally? Because I hate the smell.
[go to top]