4

Does on -p [val] from shell start a process at a specific priority?

5
  • 4
    The answer is probably no, but I'm not really sure what your question actually is. Could you expand a bit?
    – Mat
    Jan 10, 2013 at 15:10
  • which shell are you using? afaik neither bash nor dash nor tclsh nor zsh have a -p flag
    – umläute
    Jan 10, 2013 at 15:55
  • @umlaeute: bash does have a -p option. Jan 10, 2013 at 16:03
  • darn you are right (and i did check the man pages before commenting..but obviously my search was faulty); thumbs up
    – umläute
    Jan 10, 2013 at 16:06
  • Its worth noting the bash manpage does not list -p under the OPTIONS section, so it's easy to miss.
    – erco
    Nov 7, 2022 at 7:53

3 Answers 3

7

The -p option in bash and ksh is related to security. It is used to prevent the shell reading user-controlled files.

The bash manual says:

Invoked with unequal effective and real uid/gids

If Bash is started with the effective user (group) id not equal to the real user (group) id, and the -p option is not supplied, no startup files are read, shell functions are not inherited from the environment, the SHELLOPTS, BASHOPTS, CDPATH, and GLOBIGNORE variables, if they appear in the environment, are ignored, and the effective user id is set to the real user id. If the -p option is supplied at invocation, the startup behavior is the same, but the effective user id is not reset.

The ksh manual says:

A shell is privileged if the -p option is used or if the real user-id or group-id does not match the effective user-id or group-id (see getuid(2), getgid(2)). A privileged shell does not process $HOME/.profile nor the ENV parameter (see below), instead the file /etc/suid_profile is processed. Clearing the privileged option causes the shell to set its effective user-id (group-id) to its real user-id (group-id).

0
0

Use nice to run a program with modified scheduling priority

and renice to alter priority of running processes

renice 16 -p 113344

to change priority of process with Pid 113344 to 16

0

You need to use nice for add or remove priority from your processes.

/bin/nice -n NUM command-name

In this way you add a scheduling priority. For your question I suggest to see this forum page.

You must log in to answer this question.