mirror of
https://github.com/slsdetectorgroup/slsDetectorPackage.git
synced 2025-06-11 12:27:14 +02:00
Added slsReceiverScript and xterms
This commit is contained in:
42
examples/scripts/xterms
Executable file
42
examples/scripts/xterms
Executable file
@ -0,0 +1,42 @@
|
||||
#!/bin/bash
|
||||
|
||||
# This script starts several xterms, one for each argument
|
||||
# If the first argument is -k the script waits for you pressing Ctr-C and kills all started xterms afterwards.
|
||||
#
|
||||
# example:
|
||||
# xterms "ls -lah; sleep 4" "runprogramm -f 2"
|
||||
|
||||
if [ "$1" == "-k" ]; then
|
||||
DOKILL=1
|
||||
shift
|
||||
fi
|
||||
|
||||
LINE=0
|
||||
COLUMN=-330
|
||||
for i in `seq 1 $#`; do
|
||||
COLUMN=$((COLUMN+$((i%2))*330))
|
||||
echo xterm -g 50x20+${COLUMN}+${LINE} -e ${!i} &
|
||||
xterm -g 50x20+${COLUMN}+${LINE} -e ${!i} &
|
||||
PID[$i]=$!
|
||||
LINE=$((i%2*330))
|
||||
done
|
||||
|
||||
|
||||
#for i in `seq 0 $(($#-1))`; do
|
||||
# LINES=$(((i-i%4)/4))
|
||||
# arg=$((i+1))
|
||||
# xterm -g 50x20+$(((i%4)*330))+$((LINES*330)) -e ${!arg} &
|
||||
# PID[$i]=$!
|
||||
#done
|
||||
|
||||
if [ "$DOKILL" != "1" ]; then
|
||||
exit
|
||||
fi
|
||||
|
||||
while (true); do
|
||||
read
|
||||
done
|
||||
|
||||
for i in ${PID[@]}; do
|
||||
kill $i
|
||||
done
|
Reference in New Issue
Block a user