"command preprocessing" with bash - string parsing and handling pipes
The infinite loop with break, counter, and multiple invocations of cut looks clumsy at best. Consider instead

IFS=";"
for segment in $data; do
    # your logic here
done

Similarly, cutting the segment is unnecessary:

    IFS=":"
    set $segment
    export $1=$2
    IFS=";"


does the same job.
I don't understand the goal not achieved yet. The script has no knowledge where its input coming from. Whoever calls your script is in the position to redirect it at will. Perhaps, close stdin before invoking it?