| 1 |
#!/bin/sh |
| 2 |
############################################################################### |
| 3 |
# Copyright (c) 2000-2021 Ericsson Telecom AB |
| 4 |
# All rights reserved. This program and the accompanying materials |
| 5 |
# are made available under the terms of the Eclipse Public License v2.0 |
| 6 |
# which accompanies this distribution, and is available at |
| 7 |
# https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.html |
| 8 |
# |
| 9 |
# Contributors: |
| 10 |
# Balasko, Jeno |
| 11 |
# Raduly, Csaba |
| 12 |
# |
| 13 |
############################################################################### |
| 14 |
|
| 15 |
# SCCSID: %Z%%M% %I% %G% |
| 16 |
# |
| 17 |
|
| 18 |
head -1 > /tmp/$$.input |
| 19 |
if xterm -title "Question from TTCN" -e sh -c "echo ''; cat /tmp/$$.input; echo ''; echo 'Answer Yes or No and Press RETURN'; head -1 > /tmp/$$.output" |
| 20 |
then |
| 21 |
ans=`cat /tmp/$$.output` |
| 22 |
case $ans in |
| 23 |
Yes*) echo "Yes";; |
| 24 |
yes*) echo "Yes";; |
| 25 |
YES*) echo "Yes";; |
| 26 |
Y*) echo "Yes";; |
| 27 |
No*) echo "No";; |
| 28 |
no*) echo "No";; |
| 29 |
NO*) echo "No";; |
| 30 |
N*) echo "No";; |
| 31 |
*) echo $ans;; |
| 32 |
esac |
| 33 |
/bin/rm -f /tmp/$$.input |
| 34 |
/bin/rm -f /tmp/$$.output |
| 35 |
exit 0 |
| 36 |
else |
| 37 |
/bin/rm -f /tmp/$$.input |
| 38 |
/bin/rm -f /tmp/$$.output |
| 39 |
exit 1 |
| 40 |
fi |