[PD] [shell] issue

Thomas Mayer thomas at dergrossebruder.org
Mon Apr 28 12:13:10 CEST 2008


Olivier Heinry wrote:
> hi,
> 
> I've got this command line that flushes the disk cache on Linux 2.6.16 and later that's very useful to clean big video files from RAM:
> 
> 	sudo sync; sudo echo 1 > /proc/sys/vm/drop_caches
>
> Any of you has an idea how to give a [sudo cmd( message to the [shell] object and on-interactively give the sudo password?


One way is to exclude these commands from needing the password via
http://lists.debian.org/debian-user/2004/02/msg00656.html

Another way is pipelining stdin:
echo "YOURPASSWORD"|sudo sync; ...

or for some real shell programming and using a textfile for stdin:
http://www.tldp.org/LDP/abs/html/io-redirection.html

cu Thomas
-- 
"Prisons are needed only to provide the illusion that courts and police
are effective. They're a kind of job insurance."
(Leto II. in: Frank Herbert, God Emperor of Dune)
http://thomas.dergrossebruder.org/




More information about the Pd-list mailing list