Sponsored Content
Top Forums Shell Programming and Scripting Use the get and post method in the bash ( multi process)? Post 303026261 by mnnn on Thursday 22nd of November 2018 07:51:46 PM
Old 11-22-2018
Use the get and post method in the bash ( multi process)?

hi
I want to call a lot of links with the post method

What to do to speed it up??


Code:
####This method is slow


#!/bin/bash


func2() {
   index1=0
   while read line ; do
     index1=$(($index1+1))
     url[$index1]=$line
   done < tmp/url1.txt
}

func3() {
 for((j=1;j<=$countline;j++)); do
     i=`curl -LI ${url[$j]} -o /dev/null -w '%{http_code}\n' -s  ` ;
        echo "$i --- ${url[$j]}"
  done
 }
    
funcrun(){
   for ((n=1;n<=5;n++)) ; do
        func3 $countline ${url[@]}  >> 2.txt &
    done
}
   func2 
   funcrun


Last edited by mnnn; 11-22-2018 at 09:02 PM..
 

9 More Discussions You Might Find Interesting

1. Programming

message queues and multi-process

Hi, Am supposed to use message queues to send and receive messages between the processes. when i was working on that i realised that the message qid and the message queue related data should be maintained in a shared memory so that it can be accessed by all the processes. Could anybody refer... (10 Replies)
Discussion started by: rvan
10 Replies

2. Programming

Redirect Output Multi-Process

Hi, I'm trying to compile the following code: /************** Begin <test.c> ***************/ /* * Compiled with: gcc -Wall -o test test.c */ #include <stdio.h> #include <unistd.h> int main(void) { printf("I'm process %d, son of %d \n", getpid(), getppid()); printf("Hello \n");... (3 Replies)
Discussion started by: djodjo
3 Replies

3. Programming

Redirect Standard Output Multi-Process

Hi, I'm trying to compile the following code: /************** Begin <test.c> ***************/ /* * Compiled with: gcc -Wall -o test test.c */ #include <stdio.h> #include <unistd.h> int main(void) { printf("I'm process %d, son of %d \n", getpid(), getppid()); ... (5 Replies)
Discussion started by: djodjo
5 Replies

4. Shell Programming and Scripting

starting a bash session as child process to another bash session from a process

Hi I want to do something that might sound strange. I have a code that in written in C and is executed at startup (it's a custom process). It occasionally calls some bash scripts. The process doesn't have any terminal associated with it. One thing I don't know how to do is to start a... (5 Replies)
Discussion started by: alirezan
5 Replies

5. High Performance Computing

What is it about OpenMosix that supports multi-process applications?

I read that 'Any single program that can run as multiple processes can benefit from OpenMosix: "The GIMP" photo editor and the "kandel" fractal generator are known to do this. Are there other load-balancing clusters that do support multi-process applications? (1 Reply)
Discussion started by: Advice Pro
1 Replies

6. Shell Programming and Scripting

[KSH/Bash] Starting a parent process from a child process?

Hey all, I need to launch a script from within 2 other scripts that can run independently of the two parent scripts... Im having a hard time doing this, if anyone knows how please let me know. More detail. ScriptA (bash), ScriptB (ksh), ScriptC (bash) ScriptA, launches ScriptB ScirptB,... (7 Replies)
Discussion started by: trey85stang
7 Replies

7. Shell Programming and Scripting

script for multi-threaded bash processes

hey everyone, I'm having some trouble breaking down some code. It's simple a control script that takes machines meant to be backed up from a list. Then according to that will run multi-threaded processes up until the specified thread limit. for example if there are 4 machines to be backed up,... (2 Replies)
Discussion started by: terrell
2 Replies

8. Programming

Multi process programming in C

So I am trying to learn C and am coding some scripts on my own. For a start I have decided to port the shell script developed by wisecracker into C.( Here is the link to that script A simple reminder script for beginners to shell scripting. | Unix Linux Forums | OS X (Apple) ) This is what I... (7 Replies)
Discussion started by: chacko193
7 Replies

9. Shell Programming and Scripting

Multi Dimensional array in bash

Hi, I'm developing a script which contains a multi dimensional array, however for some reason the array is not iterating. When executing the script, services are listed as arguments from argument 2. Ex voice data sms. service=${@:2}; for services in $service do ... (2 Replies)
Discussion started by: nms
2 Replies
GENLIB_PLACE_ON.3(October 1, 1997)										GENLIB_PLACE_ON.3(October 1, 1997)

NAME
GENLIB_PLACE_ON - place a physical instance in the current figure matching connectors SYNOPSYS
#include <genlib.h> void GENLIB_PLACE_ON(figname,ins1,con1,index1,symetry,ins2,con2,index2) char *figname, *ins1, *con1, *ins2, *con2; char symetry; long index1, index2; ORIGIN
This software belongs to the ALLIANCE CAD SYSTEM developed by the ASIM team at LIP6 laboratory of Universite Pierre et Marie CURIE, in Paris, France. Web : http://asim.lip6.fr/recherche/alliance/ E-mail : alliance-users@asim.lip6.fr PARAMETERS
figname Name of the layout figure to be instanciated ins1 Name to be given to the instance in the model con1 Name of the connector of the instance to be used for placement index1 Index of the connector, or reference, con1 of the model to be used for placement symetry Geometrical operation to be performed on the instance before beeing placed ins2 Name of the instance to be used for relative placement con2 Name of the connector of the instance ins2 on which the placement will take place index2 Index of the connector con2 of the instance to be used for relative placement DESCRIPTION
PLACE_ON add an instance in the current layout cell. The bottom left corner of the instance of the model modelname is placed, after beeing symetrized and/or rotated, at (x, y) coordinates. The placed instance becomes the new "reference instance", used in the relative placement functions. The insname is the name given to the instance and must be unique at a given hierarchy level. The symetry argument can take eight legal values : NOSYM no geometrical operation is performed SYM_Y Y becomes -Y, that means toward X axe symetry SYM_X X becomes -X, that means toward Y axe symetry SYMXY X becomes -X, Y becomes -Y ROT_P a positive 90 degrees rotation take place ROT_M a negative 90 degrees rotation take place SY_RP Y becomes -Y, and then a positive 90 degrees rotation take place SY_RM Y becomes -Y, and then a negative 90 degrees rotation take place The model of the figure to be placed must be available, on disk or in memory. The path to the library is specified in the MBK_CATA_LIB (1) and MBK_WORK_LIB (1) environment variables, and its format is given by the MBK_IN_PH (1) environment variable. ERRORS
"GENLIB_PLACE_ON impossible : missing GENLIB_DEF_PHFIG" No figure has been yet specified by a call to DEF_PHFIG. So it isn't possible to place an instance inside it. you must call DEF_PHFIG before any other layout action. "illegal addphins : transformation is x in insname" The symetry parameter is not one of the define given, but has the integer value x. EXAMPLE
#include <genlib.h> main() { /* Create a figure to work on */ GENLIB_DEF_PHFIG("cell"); /* Place two instances */ GENLIB_PLACE_ON("gapg0_b","ins1", NOSYM, 0L, 0L); GENLIB_PLACE_ON("gapg8_b","ins2", SYM_X, 80L, 100L); /* Save all that on disk */ GENLIB_SAVE_PHFIG(); } SEE ALSO
genlib(1), GENLIB_DEF_PHFIG(3), GENLIB_SAVE_PHFIG(3), GENLIB_PLACE_TOP(3), GENLIB_PLACE_BOTTOM(3), GENLIB_PLACE_LEFT(3), GEN- LIB_PLACE_RIGHT(3), MBK_CATA_LIB(1), MBK_WORK_LIB(1), MBK_IN_PH(1). BUG REPORT
This tool is under development at the ASIM department of the LIP6 laboratory. We need your feedback to improve documentation and tools. PROCEDURAL GENERATION LANGUAGE
ASIM/LIP6 GENLIB_PLACE_ON.3(October 1, 1997)
All times are GMT -4. The time now is 05:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy