السلام عليكم
لدي مشكلة في تنفيذ هذا السكربت :
#! /bin/sh
base=/home/www
read request
while true; do
read header
if [ "$header" == $'\r' ]; then
break
fi
done
urlfile=`echo "$request" | sed -r "s/.*GET[ ]+[\/]?(.*)[ ]+HTTP.*/\1/g"`
if [ -z "$urlfile" ]; then
urlfile="index.html"
fi
filename="$base/$urlfile"
if [ -f "$filename" ]; then
echo -e "HTTP/1.1 200 OK\r"
echo -e "Content-Type: text/html\r"
echo -e "\r"
cat "$filename"
echo -e "\r"
else
echo -e "HTTP/1.1 404 Not Found\r"
echo -e "Content-Type: text/html\r"
echo -e "\r"
echo -e "404 Not Found\r"
echo -e "Not Found
The requested resource was not found\r"
echo -e "\r"
fiقمت بتنفيذ السكربت عن طريق chmode +x و ./NameOfShellScript و لكن لم أعرف مدخلات السكربت و مُخرجاته ؟
ملاحظة : أعمل حاليا على توزيعة Ubuntu.
شكرا.
