Re: How to use ``nice'' on a pipe?
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Alex Samad wrote:
> what about
>
> nice bash -e '<script>'
>
> On Sun, Mar 09, 2008 at 05:34:48PM +0800, Wei Chen wrote:
> 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
> =================================
>
Hi, did you mean "bash -c" ? I have tried and it works. But a small
problem is that it messes up syntax highlights in vim.
Finally I choose the method like this:
runprogram command1 | runprogram command2
which was provided by an off-list reply.
Thank you all for your help :)
- --
Cheers,
Wei Chen
http://www.acplex.com/people/wchen/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
iD8DBQFH08+OCIqXQV6BF28RAiMcAJ0dbgpEO4YgQvg/yFLr664f9RDpcgCgv/HZ
g8SPCAVbbrA2LaAP8u6H5JU=
=Asqi
-----END PGP SIGNATURE-----
Reply to: