I am trying to implement a simple log server in Bash. It should take a file as a parameter and serve it on a port with netcat.
( tail -f $1 & ) | nc -l -
Have you tried:
nc -l -p 9977 -c "tail -f $1"
(untested)
Or -e with a scriptfile if your nc doesn't have -c. You may have to have an nc that was compiled with the GAPING_SECURITY_HOLE option. Yes, you should infer appropriate caveats from that option name.
-e
nc
-c
GAPING_SECURITY_HOLE