what does the operation '>&' mean in a shell script


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers what does the operation '>&' mean in a shell script
# 1  
Old 05-17-2008
what does the operation '>&' mean in a shell script

hi, all,

i saw a syntax like this

usr/local/mpiexec -np 8 /home/XXXX/program_exe >& ./temp/out

the output will be put into ./temp/out.

I want to know the meaning of the operation symbol '>&'.


Thanks
# 2  
Old 05-17-2008
It redirects standard error as well as standard output to the file in question.

See the manual page of your shell for detailed information about redirection operators.
# 3  
Old 05-17-2008
Quote:
Originally Posted by era
It redirects standard error as well as standard output to the file in question.

See the manual page of your shell for detailed information about redirection operators.
in that case,
shouldn't that be as
>1 2>&1
# 4  
Old 05-17-2008
It should, but it's available as a shorthand at least in bash. The manual discourages this use. I imagine it's offered for compatibility with older shells.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

String operation in csh shell

Hi, to everybody i have a string which Looks like this FT47;3;1;1;;;1;09.02.2017 21:21:19;2;2 and i would like to change to value on one Position only e.g. the values on Position 6 should change to 1 nevertheyless which values was there before AIX 4.3.2.0 and csh i try... (10 Replies)
Discussion started by: Nadielosabra
10 Replies

2. Shell Programming and Scripting

SFTP Shell Script Get & Delete && Upload & Delete

Hi All, Do you have any sample script, - auto get file from SFTP remote server and delete file in remove server after downloaded. - only download specify filename - auto upload file from local to SFTP remote server and delete local folder file after uploaded - only upload specify filename ... (3 Replies)
Discussion started by: weesiong
3 Replies

3. Shell Programming and Scripting

Help me to perform count & group by operation in shell scripting?

Hi All, I want to display the distinct values in the file and for each distinct value how may occurance or there. Test data: test1.dat 20121105 20121105 20121105 20121105 20121106 20121106 20121106 20121105 I need to display the output like Output (2 Replies)
Discussion started by: bbc17484
2 Replies

4. Shell Programming and Scripting

Enter third column & Perform Operation

I am trying to enter a third column in this file, but the third column should that I call "Math" perform a some math calculations based on the value found in column #2. Here is the input file: Here is the desired output: Output GERk0203078$ Levir Math Cotete_1... (5 Replies)
Discussion started by: Ernst
5 Replies

5. Shell Programming and Scripting

Perl: combine Backtick & system() I/O operation?

Hi - Within perl I want to execute a system command. I want to re-direct all the output from the command to a file (@result = `$cmd`;), but I ALSO want the results to be displayed on the screen (system("$cmd"); The reason is this - if the command completes, I want to process the output. If the... (6 Replies)
Discussion started by: jeffw_00
6 Replies

6. UNIX for Advanced & Expert Users

Network Shell Script & Blade Logic & Network Security

I am going to take up a position in Data & Network Security. I would need to write network shell scripts doing the following task: Going to around 2000 servers and findout which groups has access to each servers and which ids are there in each group that has access. I need to implement... (1 Reply)
Discussion started by: pinnacle
1 Replies

7. UNIX for Dummies Questions & Answers

Editing & Saving using shell script

Hi, OS: Unix, linux, hp-unix (all unix flavours) Iam trying to change some string values, special characters or otherwise in a file. As of now, i go using vi <filename>, open the file and do the edit manually and save it. Is it possible to write a shell script so that i just run the script... (4 Replies)
Discussion started by: kenkanya
4 Replies

8. Shell Programming and Scripting

Shell script & cron

Hi everybody! I'm struggling against a script that won' t work right in a cron job this is my script: cat serverlist | while read arg do if then echo "$arg" ping -c 4 $arg >> /dev/null if then ... (3 Replies)
Discussion started by: deppy82
3 Replies

9. Shell Programming and Scripting

division operation in shell script

Hi guys I am trying to divide 2 variables that I got during the execution of script, but I unable to divide the variables. pls help. Hers is the code. num_tasks=`sqlplus -s batch_user/batch_user@acsblest << EOF1 set heading off SET FEEDBACK OFF SET PAGESIZE 0 SET LINESIZE 900 select... (31 Replies)
Discussion started by: ragha81
31 Replies

10. Shell Programming and Scripting

telnet & su in shell script

Hi, Any scripting experts out there that can point me to the right direction of writing a script using telnet and su to access a server without any users interaction such as login and entering passwd. Thanks. Thanks in advance vastare (1 Reply)
Discussion started by: vastare
1 Replies
Login or Register to Ask a Question