04-11-2016
That was really help, and nice explanation
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
echo -e "Enter in a username : \c"
read username
grep "^$username:" /etc/passwdWhat I'm trying to do is take in a username from my script and I need to be able to check if that username already exists. If it does the script should display a message saying that the user already exists and exit.
... (2 Replies)
Discussion started by: shadowcat
2 Replies
2. BSD
I want to create a shell script for a menu selection consisting of users defined on the machine. To an administrator having the privileges, the selection menu will look as follows:
Select the user you want to define the variables for:
1) my-username-1
2) my-username-2
etc
Then there would be a... (7 Replies)
Discussion started by: figaro
7 Replies
3. Shell Programming and Scripting
0
Hi,
I am looking for a way of creating multiple directories using the mkdir -p command in a shell script.
I'm working with an Ubuntu machine and try to do something like that:
#!/bin/sh
... (3 Replies)
Discussion started by: frymor
3 Replies
4. Shell Programming and Scripting
Can any one please let me know the shell script to change the password for a particular user on multiple linux servers. (2 Replies)
Discussion started by: s_madras
2 Replies
5. Shell Programming and Scripting
Hi, I am a new on this forum but i like :) I need a script in bash which will be crating a new user with folder for websites. For example: I will run this program and he creating a new user(with my name) and folder whcich name like user and if i will localho/~user in browser, she show me files from... (1 Reply)
Discussion started by: puclavv
1 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I wants to create the users for multiple machine from single main server using the shell script ,can you please help me on this.... (2 Replies)
Discussion started by: Rahulne25
2 Replies
7. Shell Programming and Scripting
Hello Everybody
i am a newbie to the bash scripting.please can someone help me out here.i want to write a script on creating 10 users with passwords and comparing the users to the ones in /etc/passwd file.am i gonna use arrays in creating the 10 users or what?and again, how do i compare both... (1 Reply)
Discussion started by: bruno_brunt
1 Replies
8. Shell Programming and Scripting
I need somebody who could help with an exercise.
You have a text file called users.txt with this info inside:
users.txt:
user1:1234:/home/homedir1 ;
user2:1234:/home/homedir2 ;
user3:1234:/home/homedir3 ;
user4:1234:/home/homedir4 ;
The script should create an user using the... (2 Replies)
Discussion started by: marcosruiz
2 Replies
9. Red Hat
Hi friends could you please share me the script to create more users in one server except newusers, is there any option to change secondary group and how to print passwd and changing the age all these things how can i edit in newsers.. please help me (0 Replies)
Discussion started by: indiankrish
0 Replies
10. HP-UX
Hi,
I have a file with usernames, and the comment section, e.g :
Data removed by request of sanchitadutta91, 20 May 2020
I need to add these users into a server. Is it possible to use a script to create the users, together with the comment ?
From the commandline to add one user, the... (2 Replies)
Discussion started by: anaigini45
2 Replies
nice(2) System Calls nice(2)
NAME
nice - change priority of a process
SYNOPSIS
#include <unistd.h>
int nice(int incr);
DESCRIPTION
The nice() function allows a process to change its priority. The invoking process must be in a scheduling class that supports the nice().
The nice() function adds the value of incr to the nice value of the calling process. A process's nice value is a non-negative number for
which a greater positive value results in lower CPU priority.
A maximum nice value of (2 * NZERO) -1 and a minimum nice value of 0 are imposed by the system. NZERO is defined in <limits.h> with a
default value of 20. Requests for values above or below these limits result in the nice value being set to the corresponding limit. A nice
value of 40 is treated as 39.
Calling the nice() function has no effect on the priority of processes or threads with policy SCHED_FIFO or SCHED_RR.
Only a process with the {PRIV_PROC_PRIOCNTL} privilege can lower the nice value.
RETURN VALUES
Upon successful completion, nice() returns the new nice value minus NZERO. Otherwise, -1 is returned, the process's nice value is not
changed, and errno is set to indicate the error.
ERRORS
The nice() function will fail if:
EINVAL The nice() function is called by a process in a scheduling class other than time-sharing or fixed-priority.
EPERM The incr argument is negative or greater than 40 and the {PRIV_PROC_PRIOCNTL} privilege is not asserted in the effective set of
the calling process.
USAGE
The priocntl(2) function is a more general interface to scheduler functions.
Since -1 is a permissible return value in a successful situation, an application wishing to check for error situations should set errno to
0, then call nice(), and if it returns -1, check to see if errno is non-zero.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Interface Stability |Standard |
+-----------------------------+-----------------------------+
|MT-Level |Async-Signal-Safe |
+-----------------------------+-----------------------------+
SEE ALSO
nice(1), exec(2), priocntl(2), getpriority(3C), attributes(5), privileges(5), standards(5)
SunOS 5.10 1 Apr 2004 nice(2)