Sponsored Content
Full Discussion: multiple processes overlap
Top Forums Shell Programming and Scripting multiple processes overlap Post 302274508 by JerryHone on Wednesday 7th of January 2009 06:46:17 PM
Old 01-07-2009
Unix doesn't necessarily flush the content to disk as soon as you've called echo. It will wait for a complete block of text or will force the flush when the file descriptors are closed, typically at the end of the script. You should be able to see this effect if you create a file slowly, such as...
Quote:
while true
do
echo x > /tmp/junk
sleep 1
done
and monitor /tmp junk as it's being written with
Quote:
tail -f /tmp/junk
It's difficult to force a flush to disk in Shell script. In Perl, you can use AUTOFLUSH ($!).
In shell, you could attempt to run the echo in a subshell - enclose the command in parentheses
Quote:
(echo `date +"%m/%d %H:%M"` $strTableName..$dbname - bcp out finished successfully)
although I'm not sure how succesful this would be!

Hope that helps.

Jerry
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Doubt about multiple processes

Suppose that I am performing some operation on an sql database. Lets say process of Searching and then if a value is found, updating it... Now, when I have some millions of records on which the operation has to be performed... Does it help to spawn multiple processes each executing the same... (9 Replies)
Discussion started by: Legend986
9 Replies

2. UNIX for Advanced & Expert Users

Crontab spawning multiple at processes

Hi - I need help. My user crontab is spawning multiple at processes (and multiple mencoder program starts, that exit, then restart, repeatedly), locking up my system. For example I have this entry in my crontab: $ sudo crontab -u victoria -e * * * * * ~/recordings/pvr1 * * * * *... (10 Replies)
Discussion started by: gstuart
10 Replies

3. UNIX for Dummies Questions & Answers

Running multiple processes in Linux

Hi guys, I want to run the multiple scripts at the same time using a ksh script. For example, I have three scripts to run: a.ksh, b.ksh and c.ksh How to start the above 3 scripts simultaneously and then on the completion of the above scripts I have other tasks to schedule. Thanks Gary (6 Replies)
Discussion started by: abcabc1103
6 Replies

4. Programming

Program to spawn multiple processes

I'm trying to make a program that will spawn multiple child processes then exit. I'm having trouble figuring out how to do this since after I fork, the child process begins running the program again (never ending). int main(void){ for(int i = 0; i < 3; i++){ fork(); }... (1 Reply)
Discussion started by: cagney58
1 Replies

5. Programming

Creating Multiple Processes

I am having problems creating multiple forks. I want create a certain number of forks, each call a program and each wait for a different value. How is this accomplished my loop is not doing the trick. for (i = 0; i < 5; i++) { if (fork() < 0) { //print error } ... (3 Replies)
Discussion started by: Vikings1201
3 Replies

6. Programming

Capture stdout from multiple processes

I have a number of binaries which I currenlty have no control over. They alright data to stdout. I would like to kick off any number of these binaries and capture and process their stdout. Doing this for one process is straight forward for example - comments and error checking removed for... (6 Replies)
Discussion started by: dvales
6 Replies

7. Shell Programming and Scripting

kill multiple processes by name

Want to kill multiple processes by name. for the example below, I want to kill all 'proxy-stagerd_copy' processes. I tried this but didn't work: >> ps -ef|grep proxy_copy root 991 986 0 14:45:34 ? 0:04 proxy-stagerd root 1003 991 0 14:45:49 ? 0:01... (2 Replies)
Discussion started by: catalinawinemxr
2 Replies

8. Solaris

Multiple hanged FTP processes

Hello people, I got one problem with a script. I have a script which runs every five mins and in the script an ftp process is invoked which sends files to a particular location. The problem is that the ftp process hangs every now and then which causes the whole script to hang. As the... (4 Replies)
Discussion started by: m_usmanayub
4 Replies

9. Shell Programming and Scripting

need help ps -e on multiple processes

:)Hi there, I am new to scripting and wanted to see if someone can show me how to grep on multiple processes and send the output to a file in /home/mydir/output. I am aware of ps -ef | grep on 1 process but need help looking up multiple processes, can you use this command ps -elf | grep |pid1... (4 Replies)
Discussion started by: abbya
4 Replies

10. Shell Programming and Scripting

SPAWN Multiple Processes in Unix

Hi, I have three files in my IN directory.Each file should be copied 25 times using for loop.Each file processing should run in parallel?How to spawn multiple processes in unix?Any help would be appreciated. Thanks, Liyakath (7 Replies)
Discussion started by: liyakathali
7 Replies
HTTPINFLATESTREAM(3)							 1						      HTTPINFLATESTREAM(3)

The HttpInflateStream class

CLASS SYNOPSIS
HttpInflateStream HttpInflateStream o public HttpInflateStream::__construct ([int $flags]) o public HttpInflateStream HttpInflateStream::factory ([int $flags], [string $class_name = "HttpInflateStream"]) o public string HttpInflateStream::finish ([string $data]) o public string HttpInflateStream::flush ([string $data]) o public string HttpInflateStream::update (string $data) CLASS MEMBERS
CONSTANTS
+-----+-----------------+---+ |Type | | | | | | | | | Name | | | | | | | | Description | | | | | | +-----+-----------------+---+ |int | | | | | | | | | FLUSH_NONE | | | | | | | | no forced flush | | | | | | |int | | | | | | | | | FLUSH_SYNC | | | | | | | | synching flush | | | | | | |int | | | | | | | | | FLUSH_FULL | | | | | | | | full flush | | | | | | +-----+-----------------+---+ Note Flushing usually has no effect on inflate streams. EXAMPLES
Example #1 A HttpInflateStream example <?php $stream = new HttpInflateStream; echo $stream->update($data); echo $stream->finish(); ?> PHP Documentation Group HTTPINFLATESTREAM(3)
All times are GMT -4. The time now is 10:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy