You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

22 lines
314 B

  1. #!/bin/sh
  2. if [ $# -ne 1 ]; then
  3. printf "Usage: %s [subs]\n" "$0"
  4. exit
  5. fi
  6. if [ -z "$TERMINAL" ]; then
  7. TERMINAL=xterm
  8. fi
  9. gcc publisher.c -o publisher
  10. gcc subscriber.c -o subscriber
  11. $TERMINAL -e ./publisher "$1" &
  12. i=0
  13. while [ $i -lt "$1" ]; do
  14. $TERMINAL -e ./subscriber &
  15. i=$(( i + 1 ))
  16. done