User Tools

Site Tools


средства_программирования_shell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
средства_программирования_shell [2022/09/14 10:53]
val [Проверка синтаксиса]
средства_программирования_shell [2022/09/14 10:56]
val [Web сервер на shell]
Line 391: Line 391:
 while : while :
 do do
-  read header+  read -r header
   [ "​$header"​ == $'​\r'​ ] && break;   [ "​$header"​ == $'​\r'​ ] && break;
 done done
Line 406: Line 406:
   echo `date` OK $url >> $log   echo `date` OK $url >> $log
   echo -e "​HTTP/​1.1 200 OK\r"   echo -e "​HTTP/​1.1 200 OK\r"
-  echo -e "​Content-Type: ​`/​usr/​bin/​file -bi \"​$filename\"​`\r"+  echo -e "​Content-Type: ​$(/​usr/​bin/​file -bi \"​$filename\"​)\r"
   echo -e "​\r"​   echo -e "​\r"​
   /bin/cat "​$filename"​   /bin/cat "​$filename"​
 else else
-  echo `dateERR $url >> $log+  echo "$(date)" ​ERR $url >> $log
   echo -e "​HTTP/​1.1 404 Not Found\r"​   echo -e "​HTTP/​1.1 404 Not Found\r"​
   echo -e "​Content-Type:​ text/​html;​\r"​   echo -e "​Content-Type:​ text/​html;​\r"​
   echo -e "​\r"​   echo -e "​\r"​
-  ip=`awk '/32 host/ { print f } {f=$2}'​ <<<​ "​$(</​proc/​net/​fib_trie)"​ | sort -u | grep -v 127.0.0.1` +  ip=$(awk '/32 host/ { print f } {f=$2}'​ <<<​ "​$(</​proc/​net/​fib_trie)"​ | sort -u | grep -v 127.0.0.1) 
-  echo -e "<​h1>​$url Not Found in container ​`hostnamewith ip $ip</​h1>"​+  echo -e "<​h1>​$url Not Found in container ​$(hostnamewith ip $ip</​h1>"​
 fi fi
 </​code>​ </​code>​
средства_программирования_shell.txt · Last modified: 2024/05/10 17:17 by val