If the shells script takes input parameters can we pass that and eventually turn it into some kind of web service ?
Like CGI, websocketd will pass additional URL path and query parameters as environment variables.
So you could access something like ws://somehost/?a=b and you'd access the QUERY_STRING environment variable in your script (which contains "a=b"). Virtually every scripting language already has a library for parsing CGI environment variables so you can do that.
Basically, websocketd tries to emulate CGI as much as possible, but provide WebSocket streams instead of HTTP responses.
You have to be very conscious of input escaping and validation, though; otherwise your box will be owned in no time.