2012-11-21 21:32:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
2021-12-26 22:29:28 +00:00
|
|
|
# SPDX-FileCopyrightText: 2021-2022 Ole Tange, http://ole.tange.dk and Free Software and Foundation, Inc.
|
2021-03-22 20:16:35 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2016-08-21 13:37:59 +00:00
|
|
|
minipv() {
|
|
|
|
sleep=$1
|
|
|
|
while read line; do
|
|
|
|
echo "$line"
|
|
|
|
sleep $sleep
|
|
|
|
done
|
|
|
|
}
|
|
|
|
export -f minipv
|
|
|
|
|
2012-11-21 21:32:50 +00:00
|
|
|
echo '### Test id = --id `tty`'
|
2016-08-21 13:37:59 +00:00
|
|
|
parallel --id `tty` --lb --semaphore seq 1 10 '|' minipv 0.1
|
2012-11-21 21:32:50 +00:00
|
|
|
echo '### Test default id = --id `tty`'
|
2016-08-21 13:37:59 +00:00
|
|
|
parallel --lb --semaphore seq 11 20 '|' minipv 0.01
|
2012-11-21 21:32:50 +00:00
|
|
|
echo '### Test --semaphorename `tty`'
|
|
|
|
parallel --semaphorename `tty` --semaphore --wait
|
|
|
|
echo done
|