I don't know if there's a better name for what I call "file collision"... Basically, I have a script that I'm using for quick and dirty MySQL testing. Here's the idea...
Now, what I'd really like to do is add these time parameters:
However, this seems to sometimes result in weird output, such as:
It appears that multiple writes are "colliding", resulting in mixed-up data. Any suggestions on the best way to handle this? Many thanks.
You could e.g. have each process write to its own temporary file and then combine these files in the end. About your script. Why do you use a sleep statement after you put a process in the background and why is there no wait statement after the loop?
Thanks for the reply. To answer your questions, the goal of the script is to test MySQL responsiveness on a server that is showing very strange unresponsiveness. So, the script sends $1 queries to the db, waiting $2 seconds between queries. Most of my requests are simultaneous, with $2 == 0, but I wanted the ability to add a little delay (usually .1 or .2, give or take).
As for your question about wait, the answer is simple... I didn't know it existed. :-) I'd considered the possibility of writing to, then combining, files but didn't know how to get the script to wait until bg processes were finished. So, I read about that and worked it in. Thanks for the pointer. While I was at it, I made a couple of other minor improvements.
Last edited by treesloth; 01-31-2010 at 02:25 PM..
Hi 2 all,
i have had AIX 7.2
:/# /usr/IBMAHS/bin/apachectl -v
Server version: Apache/2.4.12 (Unix)
Server built: May 25 2015 04:58:27
:/#:/# /usr/IBMAHS/bin/apachectl -M
Loaded Modules:
core_module (static)
so_module (static)
http_module (static)
mpm_worker_module (static)
... (3 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address
and column 3 contains “cc” e-mail address to include with same email.
Sample input file, email.txt
Below is an sample code where... (2 Replies)
Well I have a lot of scripts that require dragging and dropping files in order to define Source files etc.
However more often then not it is the case that the path to said file contains NUMEROUS spaces.
I know one way to evade this problem is to encase the path in Quotes like this:
... (7 Replies)
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)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hi,
I've modified the syslogd source to include a thread that will keep track of a timer(or a timer thread). My intention is to check the file size of /var/log/messages in every one minute & if the size is more than 128KB, do a echo " " > /var/log/messages, so that the file size will be set... (7 Replies)
Hi Friends,
Can any of you explain me about the below line of code?
mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`
Im not able to understand, what exactly it is doing :confused:
Any help would be useful for me.
Lokesha (4 Replies)