c - Using Linux Shell to run a Client - Server for numbers of time -
i'm coded 2 programs, 1 server, other client.
the purpose of these 2 programs file transfer. first, server program started up, client program. client program receive file server.
i want run test see how time transfer many file sizes. each file size 10 times.
the code ok. when write 2 scripts this:
#!/bin/bash time=$1 for((n=0;n<time;n++)) ./server "3mb.mp3" done #!/bin/bash time=$1 for((n=0;n<time;n++)) ./client $n done and run server script first , client script. realize because of loop, many instances of server created , client. want 1 client , 1 server communicate each other @ time. when file transfer over, create new pair of client-server.
is there solution?
thank you!
(i'm using ubuntu 12.04.)
just global for loop instead of loops each client , server, if need 1 client-server per iteration. --
time=$1 for((n=0;n<time;n++)) ./server "3mb.mp3" ./client $n done to find execution time of script, can use time ./x.sh give execution time of overall script...if want execution time each iteration, have find start , end times each loop , subtract later former.
Comments
Post a Comment