I have a dictionary program, sdcv, that outputs either normal text or HTML, and I'm writing a Bash script that normalizes the output so that it simply prints stdout if sdcv is writing normal text or it prints formatted HTML using lynx if sdcv is outputting HTML.
For that purpose, I'm trying to make a Bash script I can pipe to using sdcv MYWORD | myscript.sh that will analyze sdcv's output. The problem is that sdcv has two outputs, and I need to format the second one on the basis of the first one. After the first output, sdcv requires user input, and then prints the second output.
I've tried using FIRST_OUTPUT=$(tee /dev/tty), but the problem is that this amalgamates sdcv's first output, my input requested by sdcv, and sdcv's second output, and I don't have access to anything until I've entered the input.
How could I proceed?
expectmaybe.-joption.SDCV_PAGER=./my_script sdcv WORDthe script will get the result as stdin, - but from what you write it sounds like you want both. Is this correct?