Skip to content

Instantly share code, notes, and snippets.

@sng2c
Last active September 16, 2022 04:34
Show Gist options
  • Save sng2c/2fd34a29ccaeb799f1215627472fda88 to your computer and use it in GitHub Desktop.
Save sng2c/2fd34a29ccaeb799f1215627472fda88 to your computer and use it in GitHub Desktop.
일주
#!/bin/bash
DAY=0
if [[ $4 == "음" ]]; then
DAY=1
fi
if [[ $4 == "윤" ]]; then
DAY=2
fi
HAN=$(curl 'http://sajuplus.com/manse.html' -s \
--data-raw "inName=noname&inSex=m&inDateType=$DAY&inYY=$1&inMM=$2&inDD=$3&inMI=8&inSS=0" \
| sed 's/[^甲乙丙丁戊己庚辛壬癸子丑寅卯辰巳午未申酉戌亥]//g' | awk 'NF' | sed -n -e '2 p' -e '6 p' | tr -d '\n' )
echo $HAN
echo $HAN | tr '甲乙丙丁戊己庚辛壬癸子丑寅卯辰巳午未申酉戌亥' '갑을병정무기경신임계자축인묘진사오미신유술해'
@sng2c
Copy link
Author

sng2c commented Sep 16, 2022

Usage : ilju.sh Y M D [음|윤]

~ ./ilju.sh 1979 11 20
辛卯
신묘
➜  ~ ./ilju.sh 1979 10 1 음
辛卯
신묘

http://sajuplus.com/manse.html 을 이용
음력윤달 참고 https://jaeho0523.tistory.com/1005

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment