I want to design a script that will call an existing menu script and select options one by one and redirict the out put to a file.
For example;-
In the script MENU.sh there are 10 options i want to design a script MENU2.sh that will select option 2 3 4 6 7 10 and redirict the output to xyz.txt
Hello,
If you want to create an automate, you can follow this example:
$ mkfifo exchange
$ cat menu.sh
#!/bin/bash
while true
do
echo "Valeur:"
read f
if [ "${f}" -eq "12" ]
then
echo "Bingo"
sleep 2
exit
fi
done
$ cat menu2.sh
#!/bin/bash
for i in {1..15}
do
read f
if [ "$f" = "Valeur:" ]
then
echo "$f $i" >&2
echo $i
fi
if [ "$f" = "Bingo" ]
then
echo "$f" >&2
exit
fi
done
I have redirect echo to error (>&2) otherwise we don't see nothing.
ENDED OK 33
ENDED NOTOK 1
EXECUITING 13
=====================
Now i do not want to select options one by one
and design anathor script menu2.sh that will call MENU.sh select option one by one and show me the output.