Sponsored Content
Top Forums UNIX for Dummies Questions & Answers /dev/null 2>&1 Versus /dev/null 2>1 Post 302502340 by Corona688 on Monday 7th of March 2011 05:11:20 PM
Old 03-07-2011
The one without the ampersand will write the output of standard error into a file named "1". Probably not what's intended.
This User Gave Thanks to Corona688 For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/dev/null 2>&1 question

Hi, suppose you have the following line at your crontab : 5 * * * * /usr/mine/script > /dev/null 2>&1 now i understood that the " > /dev/null 2>&1 outputs both Standard outpout and Standard Error messages to the /dev/null device or file... the first part , " > /dev/null " transfers... (1 Reply)
Discussion started by: BAM
1 Replies

2. UNIX for Dummies Questions & Answers

/dev/null

Hi , I am importing some table from /dev/null i dont understand what is /dev/null Sorry i am new to UNIX sam71 (3 Replies)
Discussion started by: sam71
3 Replies

3. Shell Programming and Scripting

> /dev/null

hello all, In many shell scripts i found '> /dev/null' , i am not able to get this, will any one please explain why we are using this. thanks sudha (2 Replies)
Discussion started by: rrs
2 Replies

4. Solaris

What is /dev/tty /dev/null and /dev/console

Hi, Anyone can help My solaris 8 system has the following /dev/null , /dev/tty and /dev/console All permission are lrwxrwxrwx Can this be change to a non-world write ?? any impact ?? (12 Replies)
Discussion started by: civic2005
12 Replies

5. Shell Programming and Scripting

Meaning of "> /dev/null 2>&1"

Hi, I am new into UNIX shell scripting and I am wondering what is the meaning of the below text which appears at the end of each line in the ".sh" file: > /dev/null 2>&1 For example, the line below: sh $HOME/stats/Rep777/Act_777.sh omc omc > /dev/null 2>&1 I know for sure what "sh... (10 Replies)
Discussion started by: salanalani
10 Replies

6. Shell Programming and Scripting

Difference between ">/dev/null 2>&1" and "2>&1 >/dev/null"

Does >/dev/null 2>&1 and 2>&1 >/dev/null mean the same? (4 Replies)
Discussion started by: proactiveaditya
4 Replies

7. Shell Programming and Scripting

Redirecting standard out to /dev/null goes to file "/dev/null" instead

I apologize if this question has been answered else where or is too elementary. I ran across a KSH script (long unimportant story) that does this: if ; then CAS_SRC_LOG="/var/log/cas_src.log 2>&1" else CAS_SRC_LOG="/dev/null 2>&1" fithen does this: /usr/bin/echo "heartbeat:... (5 Replies)
Discussion started by: jbmorrisonjr
5 Replies

8. Shell Programming and Scripting

Help with /dev/null Please

Hello All and a Happy New year to yous guys. I'm running the below command on my AIX box and it keeps giving me the message that the file doesn't exist. I know the file don't exist, but I don't want to see the error. 2>/dev/null doesn't work. bash-3.00$ ls -l C* | wc -l 2>/dev/null ls:... (2 Replies)
Discussion started by: bbbngowc
2 Replies

9. AIX

Size of file /dev/./null 2>&1

Hello Can I just remove/delete flile ? rw-r--r-- 1 root system 2385088512 Jun 30 21:25 /dev/null 2>&1 size of this flile is 2274.75 m and fill up my filesystem: Filesystem MB blocks Used Free %Used Mounted on /dev/hd4 2560.00 2558.59 1.41 100% / (10 Replies)
Discussion started by: primo102
10 Replies

10. AIX

Housekeeping null 2>&1 in /dev

Hello, Does anyone know how to housekeeping the null 2>&1 file in /dev? its fill up my system, please help. Thanks :b: (3 Replies)
Discussion started by: only
3 Replies
roleadm(1M)															       roleadm(1M)

NAME
roleadm - noninteractive editing of role-related information in RBAC databases SYNOPSIS
[comments] [role] DESCRIPTION
is a noninteractive command that allows users with the appropriate authorization to modify and list the role information in and See rbac(5) for information on these RBAC databases. HP recommends that only the and commands be used to edit and view the RBAC databases. Do not edit the RBAC files directly. Options recognizes the following options: Add a role to the system list of valid roles. Appends a line in file with rolename. You can enter an optional comment after the role. Remove a role from the system list of valid roles. If role is present in remove entry. If role is not present, then returns an error code; see Change the name of a role. This option causes a modification of the RBAC databases and replacing each occurrence of oldrolename with newrolename. Assign a role to a user or a group. First verifies that the user is a valid user, and the role is present in the file. When this is the case, the role is appended to the user->role mapping in the file. If user argument has an ampersand at the beginning (such as &users), then it is assumed that what follows after the ampersand is a group name - the ampersand must be shell escaped or put in quotes such as users or "&users". An administrator may specify a default set of roles by assigning roles to the keyword. If a user is not otherwise explicitly assigned roles in the database, he or she will be given roles assigned to the role. Revoke a role from the specified user. If no role is specified, then all roles are revoked for the given user. (The user entry is removed from If user argument has an ampersand at the beginning (such as &users), then it is assumed that what follows after the ampersand is a group name - the amper- sand must be shell escaped or put in quotes such as users or "&users". List user and role information from the RBAC databases, and If neither nor are specified, then list all the users with assigned roles. If is specified, then only the role(s) of the specified user will be listed. If user has an ampersand at the beginning (such as &users), then it is assumed that what follows after the ampersand is a group name - the ampersand must be shell escaped or put in quotes such as users or "&users". If only is specified, then only list the user(s) assigned to the specified role. If both and are specified, then the entry with the user username and role rolename will be listed, if it exists. If the specified user does not exist in the system and there exists the special user, in the database, then the roles listed for the specified user will be those of the user. In the event that there is more than one user defined in the database, the system will recognize only the last one. If is specified, then all the roles in the roles database, will be listed. When is specified, no other argument will be taken by Authorizations In order to invoke the user must either be root, (running with effective uid of 0), or have the appropriate authorization(s). The follow- ing is a list of the required authorizations for running with particular options: hpux.security.access.role.add,* Allows user to run roleadm with "add" option. hpux.security.access.role.delete,* Allows user to run roleadm with "delete" option. hpux.security.access.role.modify,* Allows user to run roleadm with "modify" option. hpux.security.access.role.assign,* Allows user to run roleadm with "assign" option. hpux.security.access.role.revoke,* Allows user to run roleadm with "revoke" option. hpux.security.access.role.list,* Allows user to run roleadm with "list" option. EXTERNAL INFLUENCES
Environment Variables determines the language in which messages are displayed. International Code Set Support Single-byte character code set is supported. RETURN VALUE
Upon completion, returns one of the following values: Success. Failure. An appropiate error message is printed to stderr. EXAMPLES
The following command will append the line to file. The following command will append the line to the file. The following command will delete line in file and other databases. The following command will delete line from the file. The following command will replace role name with in and The following command will append line to file: The following command will remove the line from file: The following command will remove all the roles for user from file: The following command will remove all the roles for group name from file: The following command will list all the roles for user The following command will list all users and groups with role The following command will list entries with user and rolename The following command will list entries with group name The following command will list all the entries in FILES
Database containing valid definitions of all roles. Database containing definitions of all valid authorizations. Database specifying the roles allowed for each specified user. Database that defines the allowed authorization for each specified role. Database containing the authorization to execute specified commands and the privileges to alter uid and gid for command execution. SEE ALSO
authadm(1M), cmdprivadm(1M), privrun(1M), rbacdbchk(1M), rbac(5). roleadm(1M)
All times are GMT -4. The time now is 10:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy