|
Thanks for your answers. That solves my problem.
I did have to improve on one aspect of the suggested solution. I know I
said my script generated "a bash command" but what I really meant was that
it generated a string of single commands separated by semicolons the sum
of which constituted (in my view) "a command". I solved that problem by
modifying the script above to be as shown below, then it all worked.
Thanks again.
OUTPUT=$(some_command)
read -e -i $OUTPUT -p "Cmd to run: " ANSWER
if [[ -z "${ANSWER}" ]]
then
echo "Nothing entered"
else
eval "$ANSWER"
fi
Last edited by GreyBeard; 02-20-2012 at 11:27 PM.
Reason: formatting
|