Keep line formatting in browser with bash CGI
问题 I'm using this bash CGI: #!/usr/bin/sh echo "Content-type: text/html" echo "" echo `ls -al` And it produces ie: total 52 drwxrwxrwx. 2 root root 4096 Feb 2 18:34 . drwxr-xr-x. 8 root root 4096 Feb 2 17:58 .. -rw-r--r--. 1 root root 36310 Feb 2 17:45 dds.jpg -rw-rw-rw-. 1 user user 50 Feb 2 18:03 dds_panel.htm -rwxrwxrwx. 1 user user 460 Feb 2 18:34 test-cgi.cgi In a terminal they appear each neatly on a single line but in the browser they appear all on the same line. What's the best way to