Editing html/css within a bash script

时间:2017-04-10 00:55:48

标签: html css bash

while true; do echo -e "HTTP/1.1 200 OK\n\n $(date)" | nc -l -p 8080; done

Been given this one liner to start a simple webserver on a raspberry pi for university. When connected it shows the day and date. I've been asked to simply change it so it displays with the text color as blue rather than black

I know html and css well, just not sure where to put it within this code or if i need to write it different

1 个答案:

答案 0 :(得分:0)

Specify a content-type to serve as text/html then you can use HTML tags with an inline style.

while true ; do echo -e "HTTP/1.1 200 OK\rContent-type: text/html\n\n <span style='color: blue'>$(date)</span>" | nc -l -p 8080; done