Search code examples
bashxterm

Bash script to execute multiple programs with arguments usins xterm


i have a server wich and i want to execute multiples programs. I think the best was use xterm in order to monitor every program output, if there are something better i would like to know it. The proble is the line 10, i need to pass a cero as an argument and i do not know how. I think there is very easy way but search without succeded.

  2 DIR=$HOME"/IRMA-III"
  3 sudo chown irma /dev/ttyACM0
  4 sudo chown irma /dev/ttyUSB0
  5 xterm $DIR"/src/init/init-cda" &
  6 xterm $DIR"/src/processors/monitor/monitor" &
  7 xterm $DIR"/src/processors/closeRangeNavigator/closeRangeNavigator" &
  8 xterm $DIR"/src/processors/laser/laser"  &
  9 xterm $DIR"/src/processors/longRangeNavigator/longRangeNavigator" &
 10 xterm $DIR"/src/processors/executive/executive" 0 &

Solution

  • The right syntax for xterm is

    xterm -e programname argument1 argument2 argument3 ... 
    

    no problem to pass "0" to the "programname"

    your line 10 should look like:

    xterm -e "$DIR/src/processors/executive/executive" "0" &
    

    Try to find a way to run your "server" tasks independent from a terminalsession. Monitoring via logfiles is easy ( like less +F logfilename ) and it makes everything rock solid.