proces meerdere keren tegelijk starten

Pagina: 1
Acties:

  • doelman
  • Registratie: April 2004
  • Laatst online: 29-01 15:16
Hoi mensen,

Ik wil (op Linux) een proces meerdere keren tegelijk starten. Dus ik wil dat een bepaald commando bijv. 50x gestart wordt op hetzelde moment. Ik kan er even niet opkomen hoe dat nou te doen. Ik weet even niet de correcte termen om op te zoeken.
Ik dacht zelf in eerste instantie aan een lusje in een Bash script mja, dan wordt het volgende commando pas uitgevoerd als het huidige klaar is.

Mijn pianomuziek: http://www.youtube.com/user/doelman


  • Viper®
  • Registratie: Februari 2001
  • Niet online
fork ?
http://www.yolinux.com/TUTORIALS/ForkExecProcesses.html
The fork() system call will spawn a new child process which is an identical process to the parent except that has a new system process ID. The process is copied in memory from the parent and a new process structure is assigned by the kernel. The return value of the function is which discriminates the two threads of execution. A zero is returned by the fork function in the child's process.

The environment, resource limits, umask, controlling terminal, current working directory, root directory, signal masks and other process resources are also duplicated from the parent in the forked child process.

[ Voor 98% gewijzigd door Viper® op 01-06-2007 10:35 ]


  • blaataaps
  • Registratie: Juli 2001
  • Niet online
doelman schreef op vrijdag 01 juni 2007 @ 10:34:
Ik dacht zelf in eerste instantie aan een lusje in een Bash script mja, dan wordt het volgende commando pas uitgevoerd als het huidige klaar is.
Alleen als je dat zo script, dat is niet een fundamentele beperking in bash ofzo, er is gewoon syntax om dat tegelijk te doen hoor :)

  • doelman
  • Registratie: April 2004
  • Laatst online: 29-01 15:16
Ok, bedankt. Ik wist niet dat daar syntax voor is blaataaps.

Mijn pianomuziek: http://www.youtube.com/user/doelman


  • Robtimus
  • Registratie: November 2002
  • Laatst online: 01-02 13:33

Robtimus

me Robtimus no like you

Check het magische teken "&". Daarmee start je het proces in de achtergrond terwijl het huidige proces (bv bash) verder gaat.

More than meets the eye
There is no I in TEAM... but there is ME
system specs


  • Boudewijn
  • Registratie: Februari 2004
  • Niet online

Boudewijn

omdat het kan

zo iets : stel dat je het 50x wil doen:

code:
1
2
3
4
for i in `seq 1 50`;
do
         abc &   
done

Zaram module kopen voor je glasvezelaansluiting?

Pagina: 1