Put the script into /www/cgi-bin/echo.sh
and make executable:
chmod +x /www/cgi-bin/echo.sh
Then you can start a webserver e.g.:
busybox httpd -f -vv -p 8080 -h /www
Now you can send requests e.g. with curl or wget:
wget -O - -S -q http://localhost:8080/cgi-bin/echo.sh
See many other CGI samples