On 2021/01/27 00:15, Christian Groessler wrote:

What is so difficult with

$ echo "3" | sudo sh -c "cat > proc/sys/vm/dropcache"

I don't get it...

regards,
chris
---- well, if you have 'sh' it might work, but it also might
run some "rc" script.
In some cases I've seen some people have their 'sudo' reset
HOME (BTW, you likely want a '/' before proc).

Some shells will use temporary files for the communications rather
than pipes. That could open various chances for race conditions, more so in the past than these days.

I've seen more than one installation of 'sudo' disallow the running of another shell and some try to drop privileges if the 1st progam run execs another program.

Normally, it may not be a problem on "your" system or on
"my" system, but in general?

Quoting the '>' to get the behavior you want seems
a bit strained, even though it might work.

I probably wouldn't _expect_ it to work on a random system that I was on unless I'd verified it to work.


Reply via email to