Why can't I `nice` a command group?

Clash Royale CLAN TAG#URR8PPP
up vote
-1
down vote
favorite
[fakename]$ nice yes a>/dev/null &
[1] 26475
[fakename]$ ps -p 26475 -o nice,pid
NI PID
10 26475
[fakename]$ nice yes a>/dev/null; &
-bash: syntax error near unexpected token `}'
Is there a way to nice a command group?
I am aware of one: to execute the command group as normal, put it in the background by appending an ampersand, and use renice on the command group. However, is there a way to accomplish the same thing with nice?
Also, why exactly is it giving me this error? Is it because nice is not a shell keyword, and thus must follow standard bash argument parsing rules?
nice
add a comment |Â
up vote
-1
down vote
favorite
[fakename]$ nice yes a>/dev/null &
[1] 26475
[fakename]$ ps -p 26475 -o nice,pid
NI PID
10 26475
[fakename]$ nice yes a>/dev/null; &
-bash: syntax error near unexpected token `}'
Is there a way to nice a command group?
I am aware of one: to execute the command group as normal, put it in the background by appending an ampersand, and use renice on the command group. However, is there a way to accomplish the same thing with nice?
Also, why exactly is it giving me this error? Is it because nice is not a shell keyword, and thus must follow standard bash argument parsing rules?
nice
add a comment |Â
up vote
-1
down vote
favorite
up vote
-1
down vote
favorite
[fakename]$ nice yes a>/dev/null &
[1] 26475
[fakename]$ ps -p 26475 -o nice,pid
NI PID
10 26475
[fakename]$ nice yes a>/dev/null; &
-bash: syntax error near unexpected token `}'
Is there a way to nice a command group?
I am aware of one: to execute the command group as normal, put it in the background by appending an ampersand, and use renice on the command group. However, is there a way to accomplish the same thing with nice?
Also, why exactly is it giving me this error? Is it because nice is not a shell keyword, and thus must follow standard bash argument parsing rules?
nice
[fakename]$ nice yes a>/dev/null &
[1] 26475
[fakename]$ ps -p 26475 -o nice,pid
NI PID
10 26475
[fakename]$ nice yes a>/dev/null; &
-bash: syntax error near unexpected token `}'
Is there a way to nice a command group?
I am aware of one: to execute the command group as normal, put it in the background by appending an ampersand, and use renice on the command group. However, is there a way to accomplish the same thing with nice?
Also, why exactly is it giving me this error? Is it because nice is not a shell keyword, and thus must follow standard bash argument parsing rules?
nice
nice
asked Aug 10 at 15:40
extremeaxe5
21916
21916
add a comment |Â
add a comment |Â
2 Answers
2
active
oldest
votes
up vote
1
down vote
accepted
The way you like to use nice would require that nice is a reserved word in the shell but it is just a normal command that takes another simple command as an argument.
There is only on case where several shells did what you like to see. This is the time command that also exists as reserved word in some shells.
add a comment |Â
up vote
0
down vote
The nice utility takes as its operand another utility (possibly with arguments). It does not take a subshell or a compound command.
To run a compound command with nice, use a child shell:
nice sh -c 'mycommand; somethingelse; while [ something ]; do ...; done'
See also:
The POSIX documentation ofnice.man niceon your system.
add a comment |Â
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
accepted
The way you like to use nice would require that nice is a reserved word in the shell but it is just a normal command that takes another simple command as an argument.
There is only on case where several shells did what you like to see. This is the time command that also exists as reserved word in some shells.
add a comment |Â
up vote
1
down vote
accepted
The way you like to use nice would require that nice is a reserved word in the shell but it is just a normal command that takes another simple command as an argument.
There is only on case where several shells did what you like to see. This is the time command that also exists as reserved word in some shells.
add a comment |Â
up vote
1
down vote
accepted
up vote
1
down vote
accepted
The way you like to use nice would require that nice is a reserved word in the shell but it is just a normal command that takes another simple command as an argument.
There is only on case where several shells did what you like to see. This is the time command that also exists as reserved word in some shells.
The way you like to use nice would require that nice is a reserved word in the shell but it is just a normal command that takes another simple command as an argument.
There is only on case where several shells did what you like to see. This is the time command that also exists as reserved word in some shells.
answered Aug 10 at 15:51
schily
9,62131437
9,62131437
add a comment |Â
add a comment |Â
up vote
0
down vote
The nice utility takes as its operand another utility (possibly with arguments). It does not take a subshell or a compound command.
To run a compound command with nice, use a child shell:
nice sh -c 'mycommand; somethingelse; while [ something ]; do ...; done'
See also:
The POSIX documentation ofnice.man niceon your system.
add a comment |Â
up vote
0
down vote
The nice utility takes as its operand another utility (possibly with arguments). It does not take a subshell or a compound command.
To run a compound command with nice, use a child shell:
nice sh -c 'mycommand; somethingelse; while [ something ]; do ...; done'
See also:
The POSIX documentation ofnice.man niceon your system.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
The nice utility takes as its operand another utility (possibly with arguments). It does not take a subshell or a compound command.
To run a compound command with nice, use a child shell:
nice sh -c 'mycommand; somethingelse; while [ something ]; do ...; done'
See also:
The POSIX documentation ofnice.man niceon your system.
The nice utility takes as its operand another utility (possibly with arguments). It does not take a subshell or a compound command.
To run a compound command with nice, use a child shell:
nice sh -c 'mycommand; somethingelse; while [ something ]; do ...; done'
See also:
The POSIX documentation ofnice.man niceon your system.
answered Aug 10 at 15:46
Kusalananda
106k14209327
106k14209327
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f461835%2fwhy-cant-i-nice-a-command-group%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password