# startup script in .bashrc to start 8 separate q processes to use in

**URL:** <https://forum.kx.com/t/startup-script-in-bashrc-to-start-8-separate-q-processes-to-use-in/12071>\
**Category:** Community Support\
**Tags:** kdb-and-q\
**Created:** [October 11, 2020, 12:48pm UTC](https://forum.kx.com/t/startup-script-in-bashrc-to-start-8-separate-q-processes-to-use-in/12071 "2020-10-11T12:48:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![simon\_watson\_sj1](https://avatars.discourse-cdn.com/v4/letter/s/85e7bf/32.png) [@simon\_watson\_sj1](https://forum.kx.com/u/simon_watson_sj1)\
**Post date:** [October 11, 2020, 12:48pm UTC](https://forum.kx.com/t/startup-script-in-bashrc-to-start-8-separate-q-processes-to-use-in/12071/1 "2020-10-11T12:48:00Z")

</div>

I’m trying to start up kdb with multiple processes to use to write scripts with KDB developer.

I understand that the processes that are set up need to be done so outside of the master process.

I have attempted to do this with a function in my .bashrc that creates 7 instances which are expecting a maximum of 8 processes. I then start up a final process with developer.

When I do this and try to connect, my OS informs developer that the connections are refused.&nbsp;

Could you advise on the correct way to start 8 processes to use with IPC in KDB?

This is my multiple process startup function in .bashrc:

mq() {

echo “Spawning 7 q processes”;

q -s -8 -p 20001;

q -s -8 -p 20002;

q -s -8 -p 20003;

q -s -8 -p 20004;

q -s -8 -p 20005;

q -s -8 -p 20006;

q -s -8 -p 20007;

}

This is the code in .bashrc to start developer:

# Assumes user name is claude and opens Q with 8 threads. (to build separate processes use a negative number)

alias q=‘rlwrap -r q -s -8’

# Developer set to open with 8 threads. (to build separate processes use a negative number)

alias developer=‘source /pathToDir/developer/config/config.profile; rlwrap -r q /pathToDir/developer/launcher.q\_’

To start all this up, I open one terminal and type `mq` then open another terminal and type&nbsp;

developer

Once in developer, I assign a handle to each process like this:

{system “q -p “,string,” -q &”} each 20001+til 7;

Then the system tells me that the connection is refused.

How should I do this?

Thanks and regards,

Simon
