пятница, 18 ноября 2011 г.

bash howto's 3


#This will remove leading spaces...
echo " 1233 test " | sed 's/^ *//g'
#This will remove trailing spaces...
echo " test 543453 " | sed 's/ *$//g'


#Make the following XML file available under http://127.0.0.1:5555/
(printf "HTTP/1.1 200 OK\\r\\nContent-Type: text/xml\\r\\n"; \
printf "Content-Length: $(cat "response.xml"|wc -c)\\r\\n\\r\\n"; \
cat response.xml") | nc -l -p 5555 >/dev/zero 2>&1 &

Комментариев нет:

Отправить комментарий