This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
средства_программирования_shell [2024/03/06 18:12] val [Целочисленный цикл (поиск хостов в подсети)] |
средства_программирования_shell [2024/05/10 17:17] (current) val [Средства программирования shell] |
||
---|---|---|---|
Line 4: | Line 4: | ||
* [[http://mywiki.wooledge.org/BashFAQ|Часто задаваемые вопросы про bash (eng)]] | * [[http://mywiki.wooledge.org/BashFAQ|Часто задаваемые вопросы про bash (eng)]] | ||
* [[https://habrahabr.ru/post/335960/|Играючи BASH'им]] | * [[https://habrahabr.ru/post/335960/|Играючи BASH'им]] | ||
+ | * [[https://unix.stackexchange.com/questions/159513/what-are-the-shells-control-and-redirection-operators|What are the shell's control and redirection operators?]] | ||
* [[https://youtu.be/GxVmukxVUo0|Видео урок]] | * [[https://youtu.be/GxVmukxVUo0|Видео урок]] | ||
Line 94: | Line 95: | ||
do | do | ||
test $i = 50 && continue | test $i = 50 && continue | ||
- | ping -c 1 -W 1 $1.$i > /dev/null 2>&1 && echo $1.$i | + | ping -c 1 -W 1 $1.$i > /dev/null 2>&1 && echo $1.$i || echo No $i |
i=$(($i + 1)) | i=$(($i + 1)) | ||
done | done | ||
Line 417: | Line 418: | ||
# echo `date` OK $filename on `hostname` >> $log | # echo `date` OK $filename on `hostname` >> $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 "$(date)" ERR $filename on "$(hostname)" >> $log | + | # echo "$(date)" ERR $filename on "$(hostname)" >> "$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" |