Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

share|improve this question

migrated from stackoverflow.com Jan 10 '13 at 17:49

This question came from our site for professional and enthusiast programmers.

3  
The answer is probably no, but I'm not really sure what your question actually is. Could you expand a bit? –  Mat Jan 10 '13 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 '13 at 15:55
    
@umlaeute: bash does have a -p option. –  Jonathan Leffler Jan 10 '13 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 '13 at 16:06
add comment

3 Answers

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).

share|improve this answer
add comment

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.