Sponsored Content
Top Forums Shell Programming and Scripting Can I pipe stderr to another process Post 302414983 by chebarbudo on Wednesday 21st of April 2010 12:24:43 PM
Old 04-21-2010
Thanks alister for offering to help.
I thought it would be embarassing to ask for help on an entire project that's why I only posted questions on specific issues.
My whole point is to parse a config file when running my script.

The config file looks like this:
Code:
PATHS_TO_WATCH	/home/ /var/www/
LIMITED_TRANSFER_RATE	800

My current script does that:
Code:
# Read config files...
eval $(while read option value; do
	echo "$option=\"$value\""
done)
# Continue with the script...

It roughly works like this but what would happen if the config file contains either mistakes (variable name with dashes) or weird values (path with space)?
Code:
PATHS_TO_WATCH	/home/ /var/www/ "/some/path/with space"
LIMITED-TRANSFER-RATE	800

How would you do that your way?
Or maybe you know of any program that does that for us!
 

10 More Discussions You Might Find Interesting

1. Programming

stderr in background process

Herez the question, In a process which writes into file FILE1 with descriptor fHandler1 and it is run as a background process where would statements be directed when stderr descriptor is used. fprintf(stderr,"some message\n"); assume that session from which it is run is terminated and... (3 Replies)
Discussion started by: matrixmadhan
3 Replies

2. Programming

sychronize process using pipe?

can pipe sychronize thread or process? because I'm trying to create 5 thread or process that can take an integer value and display it. each time a thread display the value, it has to be decrement it by 1 until the value has reach 0. The problem that I'm having is how can that integer value be... (1 Reply)
Discussion started by: saipkjai
1 Replies

3. UNIX for Advanced & Expert Users

AIX 5.3 - There is no process to read data written to a pipe

I have the following code which works on AIX 4.3 but fails at times on AIX 5.3 with: cat: 0652-054 cannot write to output. There is no process to read data written to a pipe. validator="${validator_exe} ${validator_parms}" cmd_line="${CAT} ${data_file} | ${validator}... (6 Replies)
Discussion started by: vigsgb
6 Replies

4. Linux

Can background process access to stdout,stderr

Hi folks :) Can deamonized process access to stderr, stdout? I 'm trying to display error_num/return value of a function run() in stderr using fprintf(stderr, "function run() returns = %d", ret_val); run() is called after deamonizing the process. (1 Reply)
Discussion started by: katty
1 Replies

5. Programming

Two way Pipe Process

Hi.. I am hoping someone could assist me with the pipe program I wrote below. I want to have communication from parent to child and then child to parent.. Is my logic right? int p,p1; pipe(p); pipe(p1); pid_t pid = fork(); if(pid == 0) { close(p); close(p1); dup2(p,0);... (1 Reply)
Discussion started by: therome
1 Replies

6. AIX

Tape drive problem - no process to read data written to a pipe

Hi Everyone, The machine I'm working on is an AIX 5.3 LPAR running on a P650. oslevel -r shows 5300-08. I'm trying to take a backup to a SCSI tape drive, which has been working up until this point. I know of nothing that has changed recently to cause this problem. But when I try to take a... (0 Replies)
Discussion started by: need2bageek
0 Replies

7. UNIX for Dummies Questions & Answers

No process to read data written to a pipe on AIX

We use SAP application cluster on AIX. Communication between 2 of its instances is failing randomly with the following error: java.net.SocketException: There is no process to read data written to a pipe. The above error causes a cluster restart if an important communication fails. Can... (0 Replies)
Discussion started by: RoshniMehta
0 Replies

8. Programming

Communicate with multiple process using named pipe

how to read and write on pipes to communicate with each other? (5 Replies)
Discussion started by: nimesh
5 Replies

9. Shell Programming and Scripting

Cannot make pipe for process substitution: Too many open files

Hi, I've came across an issue with a script I've been writing to check DHCP addresses on an Solaris system, the script has been running reasonably well, until it hit the following problem: ./sub_mon_v2: redirection error: cannot duplicate fd: Too many open files ./sub_mon_v2: cannot make... (3 Replies)
Discussion started by: CiCa
3 Replies

10. Shell Programming and Scripting

Using pipe command between process and concatenate

Dear all, I use a pipe command to assign a variable: $ v_LstStdCdhId=$(cat Bteq_Xport_GetLstStdViewToBuild__1274.txt | grep 'CD/39/AT/CDH_BV_ODS'|cut -d"/" -f1) $ echo "${v_LstStdCdhId}" 43 49 My aim is to concatenate for each line of the variable v_LstStdCdhId the character "/" in... (3 Replies)
Discussion started by: dae
3 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 10:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy