Sponsored Content
Top Forums Shell Programming and Scripting Difference between ">/dev/null 2>&1" and "2>&1 >/dev/null" Post 302380105 by Franklin52 on Monday 14th of December 2009 09:05:35 AM
Old 12-14-2009
Quote:
Originally Posted by proactiveaditya
Then basically ">/dev/null 2>&1" and "&> /dev/null" do the same job i guess??
Code:
&> /dev/null

Works only in Bash FWIK.
 

10 More Discussions You Might Find Interesting

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

2. UNIX for Dummies Questions & Answers

Difference between "/bin/bash" & "/bin/sh"

what if the difference between #!/bin/sh and #!/bin/bash I wrote a script with the second heading now when i change my heading to the first one ...the script is not executing well....im not getting the required output....any solution to this problem...or do i have to start the... (3 Replies)
Discussion started by: xerox
3 Replies

3. UNIX for Dummies Questions & Answers

/dev/null 2>&1 Versus /dev/null 2>1

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

4. Shell Programming and Scripting

find error?? find / -name "something.txt" 2>/dev/null

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

5. Red Hat

files having Script which works behind "who" & "w" commands

Dear All, plz print the path of files which have the script of "who" & "w" commands. thnx in advance. (6 Replies)
Discussion started by: saqlain.bashir
6 Replies

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

7. Shell Programming and Scripting

tcsh - understanding difference between "echo string" and "echo string > /dev/stdout"

I came across and unexpected behavior with redirections in tcsh. I know, csh is not best for redirections, but I'd like to understand what is happening here. I have following script (called out_to_streams.csh): #!/bin/tcsh -f echo Redirected to STDOUT > /dev/stdout echo Redirected to... (2 Replies)
Discussion started by: marcink
2 Replies

8. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

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

9. Web Development

How would I mod_rewrite "/~a1Pha" and "/=a1Pha" to "/paste/a1Pha.htm"? (internally & externally)

Basically I want to shorten URLs on my html pasting site (pasteht.ml), by using "/~a1Pha" instead of "/paste/a1Pha". The ID is 5 numbers and letters, both cases. For example: /~idnum serves /paste/idnum.htm /=idnum serves /paste/idnum.htm /paste/idnum redirects to /~idnum (to update any old... (0 Replies)
Discussion started by: phillips1012
0 Replies

10. Shell Programming and Scripting

find files in sub dir with tag & add "." at the beginning [tag -f "Note" . | xargs -0 {} mv {} .{}]

I am trying find files in sub dir with certain tags using tag command, and add the period to the beginning. I can't use chflags hidden {} cause it doesn't add period to the beginning of the string for web purpose. So far with my knowledge, I only know mdfind or tag can be used to search files with... (6 Replies)
Discussion started by: Nexeu
6 Replies
sock2path(4)							   File Formats 						      sock2path(4)

NAME
sock2path - file that maps sockets to transport providers SYNOPSIS
/etc/sock2path DESCRIPTION
The socket mapping file, /etc/sock2path, is a system file that contains the mappings between the socket(3SOCKET) call parameters and the transport provider driver. Its format is described on the soconfig(1M) manual page. The init(1M) utility uses the soconfig utility with the sock2path file during the booting sequence. EXAMPLES
Example 1: A Sample sock2path File The following is a sample sock2path file: # Family Type Protocol Path 2 2 0 /dev/tcp 2 2 6 /dev/tcp 26 2 0 /dev/tcp6 26 2 6 /dev/tcp6 2 1 0 /dev/udp 2 1 17 /dev/udp 26 1 0 /dev/udp6 26 1 17 /dev/udp6 1 2 0 /dev/ticotsord 1 6 0 /dev/ticotsord 1 1 0 /dev/ticlts 2 4 0 /dev/rawip 26 4 0 /dev/rawip6 24 4 0 /dev/rts 27 4 2 /dev/keysock SEE ALSO
soconfig(1M), socket(3SOCKET) Network Interfaces Programmer's Guide SunOS 5.10 10 Nov 1999 sock2path(4)
All times are GMT -4. The time now is 03:28 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy