PHP
php
=====PHP의 문서 외부 문서 가져오기==============================
PHP의 문서 외부 문서 가져오기, include와 require
=====PHP 리다이렉션==============================
PHP 리다이렉션(페이지 이동)의 3가지 방법
1. 메타테그를 이용한 방법
<?
echo "<meta http-equiv='refresh' content='0; url=http://pipi.5kr.kr/'>";
?>
2. 자바스크립트를 이용한 방법
<?
echo "<script>
document.location.href='http://pipi.5kr.kr/';
</script>";
?>
. 또 다른 방법
<?
echo "<script>
window.location.replace('http:http://pipi.5kr.kr/');
</script>";
?>
3. 헤더를 이용한 방법
<?
header("Location: http://pipi.5kr.kr/");
?>
=====PHP 리다이렉션==============================
=====PHP 리다이렉션==============================
PHP의 문서 외부 문서 가져오기, include와 require
=====PHP 리다이렉션==============================
PHP 리다이렉션(페이지 이동)의 3가지 방법
1. 메타테그를 이용한 방법
<?
echo "<meta http-equiv='refresh' content='0; url=http://pipi.5kr.kr/'>";
?>
2. 자바스크립트를 이용한 방법
<?
echo "<script>
document.location.href='http://pipi.5kr.kr/';
</script>";
?>
. 또 다른 방법
<?
echo "<script>
window.location.replace('http:http://pipi.5kr.kr/');
</script>";
?>
3. 헤더를 이용한 방법
<?
header("Location: http://pipi.5kr.kr/");
?>
=====PHP 리다이렉션==============================
=====PHP 리다이렉션==============================
====랜덤문자만들기===============================
https://gist.github.com/earthgecko/3089509
aaa=$(cat /dev/urandom | tr -dc [:print:] | tr -d '[:space:]\042\047\134' | fold -w 4 | head -n 1)
echo $aaa
랜덤문자 메일로보내기
aaa=$(cat /dev/urandom | tr -dc [:print:] | tr -d '[:space:]\042\047\134' | fold -w 4 | head -n 1)
echo $aaa | mail -s "a subject" to@gmail.com -a From:from@gmail.com
====주식가격 실시간 가져오기===============================
https://ansuchan.com/pandas-with-kospi/
https://gist.github.com/hagope/76ac6955ec5f450ea036
wget -q -O - http://www.google.com/finance?q=KRX:005930 | grep ref_ -m 1 | sed 's|<[^>]*>||g'
wget -q -O - http://www.google.com/finance?q=KRX:034020 | grep ref_ -m 1 | sed -e 's|<[^>]*>||g' -e 's/,//' -e 's/...$//'
wget -q -O - http://finance.naver.com/item/main.nhn?code=034020 | grep no1 -m 1 | sed 's|<[^>]*>||g' | sed 's/,//'
wget -q -O - http://finance.naver.com/item/main.nhn?code=034020 | grep no1 -m 1 | sed -e 's|<[^>]*>||g' -e 's/,//' -e 's/\t//g'
공백중 탭공백 삭제 -e 's/\t//g'
=====다른파일에서 데이타 가져오기==============================
https://zetawiki.com/wiki/Bash_%EB%B3%80%EC%88%98_%EB%8B%A4%EB%A5%B8_%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%A1%9C_%EC%A0%84%EB%8B%AC
a="$(cat test/.my_data.txt)"
# .my_data.txt에 0을 넣어둠 b='0'
if [ "$a" = "$b" ]
then echo "0이 맞습니다." # | mail -s "This is the subject" to@gmail.com -a From:from@gmail.com
else echo "0이 아닙니다." # | mail -s "This is the subject" to@gmail.com -a From:from@gmail.com
fi
=====sh 와 ./ 의차이==============================
http://psik.tistory.com/entry/shell-%EC%9D%B4%EB%9E%80-sh-%EC%99%80-bash%EC%9D%98-%EC%B0%A8%EC%9D%B4%EC%A0%90
http://forum.falinux.com/zbxe/?document_srl=786217&mid=lecture_tip&order_type=desc&sort_index=regdate
sh 와 bash 차이
https://gist.github.com/earthgecko/3089509
aaa=$(cat /dev/urandom | tr -dc [:print:] | tr -d '[:space:]\042\047\134' | fold -w 4 | head -n 1)
echo $aaa
랜덤문자 메일로보내기
aaa=$(cat /dev/urandom | tr -dc [:print:] | tr -d '[:space:]\042\047\134' | fold -w 4 | head -n 1)
echo $aaa | mail -s "a subject" to@gmail.com -a From:from@gmail.com
====주식가격 실시간 가져오기===============================
https://ansuchan.com/pandas-with-kospi/
https://gist.github.com/hagope/76ac6955ec5f450ea036
wget -q -O - http://www.google.com/finance?q=KRX:005930 | grep ref_ -m 1 | sed 's|<[^>]*>||g'
wget -q -O - http://www.google.com/finance?q=KRX:034020 | grep ref_ -m 1 | sed -e 's|<[^>]*>||g' -e 's/,//' -e 's/...$//'
wget -q -O - http://finance.naver.com/item/main.nhn?code=034020 | grep no1 -m 1 | sed 's|<[^>]*>||g' | sed 's/,//'
wget -q -O - http://finance.naver.com/item/main.nhn?code=034020 | grep no1 -m 1 | sed -e 's|<[^>]*>||g' -e 's/,//' -e 's/\t//g'
공백중 탭공백 삭제 -e 's/\t//g'
=====다른파일에서 데이타 가져오기==============================
https://zetawiki.com/wiki/Bash_%EB%B3%80%EC%88%98_%EB%8B%A4%EB%A5%B8_%EC%8A%A4%ED%81%AC%EB%A6%BD%ED%8A%B8%EB%A1%9C_%EC%A0%84%EB%8B%AC
a="$(cat test/.my_data.txt)"
# .my_data.txt에 0을 넣어둠 b='0'
if [ "$a" = "$b" ]
then echo "0이 맞습니다." # | mail -s "This is the subject" to@gmail.com -a From:from@gmail.com
else echo "0이 아닙니다." # | mail -s "This is the subject" to@gmail.com -a From:from@gmail.com
fi
=====sh 와 ./ 의차이==============================
http://psik.tistory.com/entry/shell-%EC%9D%B4%EB%9E%80-sh-%EC%99%80-bash%EC%9D%98-%EC%B0%A8%EC%9D%B4%EC%A0%90
http://forum.falinux.com/zbxe/?document_srl=786217&mid=lecture_tip&order_type=desc&sort_index=regdate
sh 와 bash 차이
=====선택문 ==============================
http://www.unix.com/shell-programming-and-scripting/158387-help-loop-case-statement-script.html
while true
do
echo "Would you like to:"
echo "1) See your name"
echo "2) See your current directory"
echo "3) See your home directory"
echo "4) Quit"
echo -n ">> "
read case
case "$case" in
1) echo "username";;
2) echo "$PWD";;
3) echo "$HOME";;
4) break;;
esac
done
===== 파일 존재 유무확인==============================
http://bluelight.tistory.com/658
http://foris.tistory.com/256
FILENAME=$1
if [ -f "$FILENAME" ] ; then
echo "file exist"
else
echo "file not exist"
fi
http://www.unix.com/shell-programming-and-scripting/158387-help-loop-case-statement-script.html
while true
do
echo "Would you like to:"
echo "1) See your name"
echo "2) See your current directory"
echo "3) See your home directory"
echo "4) Quit"
echo -n ">> "
read case
case "$case" in
1) echo "username";;
2) echo "$PWD";;
3) echo "$HOME";;
4) break;;
esac
done
===== 파일 존재 유무확인==============================
http://bluelight.tistory.com/658
http://foris.tistory.com/256
FILENAME=$1
if [ -f "$FILENAME" ] ; then
echo "file exist"
else
echo "file not exist"
fi
==================
************************************
==================
************************************
==================
************************************
==================
************************************
==================
************************************
댓글 없음:
댓글 쓰기