[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

How to use ``nice'' on a pipe?



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

I usually use ``nice'' and ``ionice'' to run a program in a low
priority. But with the following script, I only get command1 running in
a low priority. How can I make both command1 and command2 on the pipe
running in the low priority? Thank you.

=================================
#!/bin/sh
runprogram () {
  nice -n19 ionice -c2 -n7 "$@"
}
runprogram command1 | command2
=================================

- --
Cheers,

Wei Chen
http://www.acplex.com/people/wchen/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)

iD8DBQFH0684CIqXQV6BF28RAvhkAKDFHHCqrBivZ76qx7rYDnXjRrF4OgCeKVcm
ra/9VH1h5yS0vQtU5MnrEQI=
=Gqpw
-----END PGP SIGNATURE-----


Reply to: