Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

What does -p do on shell script?

Writer Sebastian Wright

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

4

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

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

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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy