셸 스크립트에 문제가있어 도움을 받으실 수 있기를 바랍니다.
는 다음 코드의 HTML 서식을 최적화 할 : Linux busybox 셸 스크립트 html 서식
#! /bin/sh
cat <<EOF > myfile # temporary file
#! /bin/sh
echo -e "Content-type: text/html; charset=iso-8859-1\n\n"
echo -e "<html><head>\c"
echo -e "<title></title>"
echo -e "</head>"
echo -e "<body>\c"
echo -e "<p>Text</p>"
echo -e "</body></html>"
EOF
chmod 777 myfile
mount -o bind myfile myfile # mount temporary on the original myfile
rm myfile
나는 에코 -e 큰 따옴표를 삭제. 나는 또한 이것을 시도 :
#! /bin/sh
cat <<EOF > myfile # temporary file
#! /bin/sh
echo -e '
<html>
<head>
<title></title>
</head>
<body>
<p>Text</p>
</body>
</html>
'
EOF
chmod 777 myfile
mount -o bind myfile myfile # mount temporary on the original myfile
rm myfile
스크립트에 문제가 있습니까?
유용한 참고 사항 : 위의 코드는 .cfg 파일의 내용으로, 재부팅 할 때마다로드됩니다.
.cfg 파일은 EOF 표시 자 사이의 내용을 CGI 스크립트 인 myfile에 붙여 넣습니다.
그게 문제일까요?
도움을 청한 사람들에게 감사드립니다. 혼란 스럽기 때문에 질문을 처음부터 더 분명하게해야했습니다. 문제가 해결되었습니다. –