4
|
1 #!/bin/sh
|
|
2
|
|
3 set -e
|
|
4 set -u
|
|
5
|
6
|
6 PATH="${PATH}:/bin:/usr/bin:/usr/local/bin:/sbin:/usr/sbin:/usr/local/sbin"
|
|
7
|
4
|
8 _outdir="$(dirname "${0}")"
|
15
|
9 _outfile="bni-jpyidr.txt"
|
4
|
10
|
15
|
11 curl -s http://www.bni.co.id/id-id/beranda/informasivalas \
|
|
12 | grep -F '<td class="align-center">JPY</td>' \
|
|
13 | tail -1 \
|
|
14 | sed -e 's/.*<td class="align-center">JPY<\/td><td class="align-right">\([0-9,.]*\)<\/td>.*/\1/' \
|
|
15 | sed -e 's/,/./' \
|
|
16 > "${_outdir}/${_outfile}.new"
|
|
17
|
|
18 mv "${_outdir}/${_outfile}.new" "${_outdir}/${_outfile}"
|