Sponsored Content
Top Forums Shell Programming and Scripting Problems with I/O redirection via exec Post 302950170 by kshji on Wednesday 22nd of July 2015 03:19:29 AM
Old 07-22-2015
Steps are processed from left to right:

1st make redirect for stdout and 2nd redirect stderr (handler 2) to same as stdout (handler 1)
Code:
# ususally needed
  > redirect.stdout  2>&1

This works also but result is little surprise. Not planned.
1st set stderr same as stdout is now and 2nd redirect stdout. = stderr is same as stdout was before new setup.
Code:
# not so often needed
  2>&1 > redirect.stdout

 

10 More Discussions You Might Find Interesting

1. Programming

Help with redirection

Here is my problem. I don't know make this redirection thing work. The output file (called output.c) looks like this #include<stdio.h> int main() { int k; int m; print f("%d\n", k); printf("%d\n", m); return 0; } the input file(called input.c) is this #include<stdio.h> int... (2 Replies)
Discussion started by: Shallon1
2 Replies

2. Shell Programming and Scripting

redirection

Hi, The code below works, it's a part of a bash shell script that serve to search a pattern $pattern_da_cercare in the files contained in a directory $directory_iniziale. Now the proble is: How can I redirect stderr to a file? PS: so I want to redirect ALL the errors to a file. I tryed... (9 Replies)
Discussion started by: DNAx86
9 Replies

3. UNIX for Dummies Questions & Answers

Help with Redirection

Hi Guys, I m new to UNIX and new to this forum. Was wondering if someone can help me understand redirection (standard input output pipeline etc) for starters, not too sure what this would mean who | sort > sortedfile | pr | lp im starting to understand common commands but when throwing... (2 Replies)
Discussion started by: jmack123
2 Replies

4. Shell Programming and Scripting

Output redirection to exec does not work

Hello Experts, I am on Solaris 10 Due to some limitations in one of the vendor software, I am forced to output the command to exec and then run it from there. For example.. $(echo "/usr/bin/cp a.dat b.dat") # This works However, $(echo "/usr/bin/cat a.dat > c.dat") # This does not... (8 Replies)
Discussion started by: Gokul Kumar G
8 Replies

5. Shell Programming and Scripting

Double redirection

Hi to all. It's possible with a single line redirect to stdout and to a file a echoed string? I need something like this: echo "Pizza" >/tmp/file (and same time print to stout "Pizza")... What can i do? (2 Replies)
Discussion started by: mendez
2 Replies

6. Shell Programming and Scripting

I/O redirection

Hello everyone,I'm reading a book and there's code fragment: exec 3>&1 ls -l 2>&1 >&3 3>&- | grep bad 3>&- exec 3>&- It says that the red part of that code does not close fd 3 but the green does close the fd 3.I can't understand that.....Why?Any predicate will be appreciated.:) (18 Replies)
Discussion started by: homeboy
18 Replies

7. Shell Programming and Scripting

Redirection

Hello All, I am using the below script to gather various tools running by the user, we have more than 100 tools running on the server so my challenge is to redirect memory & cpu load to the file with the name of the tool.so am using the below script i am stucking how to redirect to the file... (2 Replies)
Discussion started by: ajaincv
2 Replies

8. UNIX for Dummies Questions & Answers

about different redirection

explain the redirections 1>, 2>, 3>, ..... and 1< ,2<,3<..... where we use these things thanks Thread moved from AIX forum (2 Replies)
Discussion started by: tsurendra
2 Replies

9. Shell Programming and Scripting

Script Variables Inquiry, Values Okay in Standalone Exec, No-Show in Cron Exec

I have the following bash script lines in a file named test.sh. #!/bin/bash # # Write Date to cron.log # echo "Begin SSI Load $(date +%d%b%y_%T)" # # Get the latest rates file for processing. # d=$(ls -tr /rms/data/ssi | grep -v "processed" | tail -n 1) filename=$d export filename... (3 Replies)
Discussion started by: ginowms
3 Replies

10. Shell Programming and Scripting

Several exec on find send all the output to the last redirection

Example script: find mydir -type f -exec echo {}>aaa \; -exec echo {}>bbb \;The two paths go the the bbb file, while there should be one of them on each file. How should I do it to get it working? (2 Replies)
Discussion started by: Tribe
2 Replies
COUCHDB(1)							   User Commands							COUCHDB(1)

NAME
couchdb - Apache CouchDB database server SYNOPSIS
couchdb [OPTION] DESCRIPTION
The couchdb command runs the Apache CouchDB server. Erlang is called with: -os_mon start_memsup false start_cpu_sup false disk_space_check_interval 1 disk_almost_full_threshold 1 -sasl errlog_type error +K true +A 4 Erlang inherits the environment of this command. You can override these options using the environment: ERL_AFLAGS, ERL_FLAGS, ERL_ZFLAGS See erl(1) for more information about the environment variables. The exit status is 0 for success or 1 for failure. OPTIONS
-h display a short help message and exit -V display version information and exit -a FILE add configuration FILE to chain -A DIR add configuration DIR to chain -n reset configuration file chain (including system default) -c print configuration file chain and exit -i use the interactive Erlang shell -b spawn as a background process -p FILE set the background PID FILE (overrides system default) -r SECONDS respawn background process after SECONDS (defaults to no respawn) -o FILE redirect background stdout to FILE (defaults to couchdb.stdout) -e FILE redirect background stderr to FILE (defaults to couchdb.stderr) -s display the status of the background process -k kill the background process, will respawn if needed -d shutdown the background process REPORTING BUGS
Report bugs at <https://issues.apache.org/jira/browse/COUCHDB>. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITH- OUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. couchdb - Apache CouchDB 1.2.0 January 2013 COUCHDB(1)
All times are GMT -4. The time now is 07:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy