12-26-2006
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 $HOME/stats/Rep777/Act_777.sh omc omc" does mean but I don't have any idea about the rest which is " > /dev/null 2>&1".
Thanks in advance.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
while (my $row = $sth->fetchrow_arrayref) {
$var->{"@$row"}=" ";
}
Can anyone help me understanding above mentioned.
i) As per my knowledge $row is taking ARRAY Refernce from the database
ii) @$row is containing the value of 0th index of the array, testted the same.
but I am not able... (0 Replies)
Discussion started by: jaigs_27
0 Replies
2. Shell Programming and Scripting
Does >/dev/null 2>&1 and 2>&1 >/dev/null mean the same? (4 Replies)
Discussion started by: proactiveaditya
4 Replies
3. UNIX for Dummies Questions & Answers
Hi:
How can I remove my own post?
Thanks. (2 Replies)
Discussion started by: phil518
2 Replies
4. Shell Programming and Scripting
I need to sort the following file by the rhdiskpower devices in the last column:
Total_MB Free_MB OS_MB Name Failgroup Library Label UDID Product Redund Path
1024 851 1024 OCRVOT1_0000 OCRVOT1_0000 System UNKNOWN ... (3 Replies)
Discussion started by: wjssj
3 Replies
5. UNIX for Dummies Questions & Answers
How are these two different? They both prevent output and error from being displayed. I don't see the use of the "&"
echo "hello" > /dev/null 2>&1
echo "hello" > /dev/null 2>1 (3 Replies)
Discussion started by: glev2005
3 Replies
6. Shell Programming and Scripting
I am new to unix and learning. Came across this statement
cmd 2>/dev/null/ <<EOF
2>/dev/null/ denotes that std error is stored in /dev/null but that is considered as a non-existent file!! What does << EOF mean and how does it affect?
I am really confused.. :wall:
Can some one explain this... (2 Replies)
Discussion started by: source
2 Replies
7. Shell Programming and Scripting
why is this giving me errors?
i type this in: find / -name "something.txt" 2>/dev/null
i get the following error messages:
find: bad option 2
find: path-list predicate-list
:confused: (5 Replies)
Discussion started by: magiling
5 Replies
8. UNIX for Dummies Questions & Answers
Hi Guys,
I'm sorry but I can't find answer for this, what is the meaning of -s option in "if" statement on unix scipting. Please see sample below:
opath=/home/output
for i in N1 N2 N3 N4
do
echo $i
if
then
grep $i $opath/N5_CRAI > $opath/N5_$i.crai
chmod 777 $opath/N5_$i.crai
... (7 Replies)
Discussion started by: rymnd_12345
7 Replies
9. Shell Programming and Scripting
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
10. Shell Programming and Scripting
Hi all.
I have a .txt file that I need to sort it
My file is like:
1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO)
2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies
LEARN ABOUT MOJAVE
device_maps
device_maps(4) File Formats device_maps(4)
NAME
device_maps - device_maps file
SYNOPSIS
/etc/security/device_maps
DESCRIPTION
The device_maps file contains access control information about each physical device. Each device is represented by a one line entry of the
form:
device-name : device-type : device-list :
where
device-name This is an arbitrary ASCII string naming the physical device. This field contains no embedded white space or non-
printable characters.
device-type This is an arbitrary ASCII string naming the generic device type. This field identifies and groups together devices
of like type. This field contains no embedded white space or non-printable characters.
device-list This is a list of the device special files associated with the physical device. This field contains valid device
special file path names separated by white space.
The device_maps file is an ASCII file that resides in the /etc/security directory.
Lines in device_maps can end with a `' to continue an entry on the next line.
Comments may also be included. A `#' makes a comment of all further text until the next NEWLINE not immediately preceded by a `'.
Leading and trailing blanks are allowed in any of the fields.
The device_maps file must be created by the system administrator before device allocation is enabled.
This file is owned by root, with a group of sys, and a mode of 0644.
EXAMPLES
Example 1: A sample device_maps file
# scsi tape
st1:
rmt:
/dev/rst21 /dev/nrst21 /dev/rst5 /dev/nrst5 /dev/rst13
/dev/nrst13 /dev/rst29 /dev/nrst29 /dev/rmt/1l /dev/rmt/1m
/dev/rmt/1 /dev/rmt/1h /dev/rmt/1u /dev/rmt/1ln /dev/rmt/1mn
/dev/rmt/1n /dev/rmt/1hn /dev/rmt/1un /dev/rmt/1b /dev/rmt/1bn:
FILES
/etc/security/device_maps
SEE ALSO
allocate(1), bsmconv(1M), deallocate(1), dminfo(1M), list_devices(1)
NOTES
The functionality described in this man page is available only if the Basic Security Module (BSM) has been enabled. See bsmconv(1M) for
more information.
SunOS 5.10 16 Jan 2001 device_maps(4)