- komatsu-san's tips
2012年5月30日水曜日
bash references
(book)
- 入門 bash ver.3 (2005)
- cookbook
- classic Shell Scripting (2006)
(not yet read)
"classic shell"
(web)
- http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
- http://www.ne.jp/asahi/yokohama/juk/bash-script.html
(kuwamura-san)
- http://www.gnu.org/software/bash/manual/bashref.html
- http://furyo.on-air.ne.jp/linux/bash.html
(in Japanese)
- 入門 bash ver.3 (2005)
- cookbook
- classic Shell Scripting (2006)
(not yet read)
"classic shell"
(web)
- http://tldp.org/LDP/Bash-Beginners-Guide/html/index.html
- http://www.ne.jp/asahi/yokohama/juk/bash-script.html
(kuwamura-san)
- http://www.gnu.org/software/bash/manual/bashref.html
- http://furyo.on-air.ne.jp/linux/bash.html
(in Japanese)
2012年5月29日火曜日
ch6-array.sh
#!/bin/bash
names[1]=alice1
names[2]=juce2
names[0]=taka0
echo ${names[0]} ${names[1]} ${names[2]}
names=(name1 name2 name3)
echo ${names[0]} ${names[1]} ${names[2]}
for i in "${names[@]}"; do
echo $i
done
names[1]=alice1
names[2]=juce2
names[0]=taka0
echo ${names[0]} ${names[1]} ${names[2]}
names=(name1 name2 name3)
echo ${names[0]} ${names[1]} ${names[2]}
for i in "${names[@]}"; do
echo $i
done
ラベル:
array,
bash,
Learn_bash
ch7-read1.sh
input="/etc/hosts"
readfile () {
while read f[0] f[1] f[2]; do
# remove line from #
if [ -z "$(echo ${f[0]} | grep ^#)" ]; then
echo ${f[0]} ${f[1]}
fi
done
}
echo "readfile $input..."
readfile < $input
echo "## pattern 2"
{
while read f[0] f[1] f[2]; do
# remove line from #
if [ -z "$(echo ${f[0]} | grep ^#)" ]; then
echo ${f[0]} ${f[1]}
fi
done
} < $input
readfile () {
while read f[0] f[1] f[2]; do
# remove line from #
if [ -z "$(echo ${f[0]} | grep ^#)" ]; then
echo ${f[0]} ${f[1]}
fi
done
}
echo "readfile $input..."
readfile < $input
echo "## pattern 2"
{
while read f[0] f[1] f[2]; do
# remove line from #
if [ -z "$(echo ${f[0]} | grep ^#)" ]; then
echo ${f[0]} ${f[1]}
fi
done
} < $input
ラベル:
bash,
Learn_bash,
read
2012年5月25日金曜日
read xspec log in python
(readLog-test1.py)
#!/usr/bin/env python
"""
2012-05-25
cp ‾/2012FY/clusters/A2319/20120410/region-0416/readLog-fit1.pl .
"""
import sys
debug = "### debug"
x_xis0=[0,0]
for line in sys.stdin:
# print debug, line,
lines = line.split()
# print debug, lines[0]
if "4 2 apec Redshift" in line:
x_xis0[0] = lines[5]
print debug, line, x_xis0[0]
if "9 2 apec Redshift" in line:
x_xis0[1] = lines[5]
print debug, line, x_xis0[1]
print "x_xis0 is", x_xis0[0],x_xis0[1]
#!/usr/bin/env python
"""
2012-05-25
cp ‾/2012FY/clusters/A2319/20120410/region-0416/readLog-fit1.pl .
"""
import sys
debug = "### debug"
x_xis0=[0,0]
for line in sys.stdin:
# print debug, line,
lines = line.split()
# print debug, lines[0]
if "4 2 apec Redshift" in line:
x_xis0[0] = lines[5]
print debug, line, x_xis0[0]
if "9 2 apec Redshift" in line:
x_xis0[1] = lines[5]
print debug, line, x_xis0[1]
print "x_xis0 is", x_xis0[0],x_xis0[1]
xselect from python
see also uchiyama's blog
#!/usr/bin/env python
"""
2012-05-25
test
http://aidememoirehu.blogspot.jp/search/label/Python
"""
MY_NAME = "run_xselect2"
import sys
import os
import subprocess
out_name = 'test' + MY_NAME
out_com = out_name+'.com'
# if out_com is already present
# overwrite
com = open (out_com, 'w')
ev_file = "test_evlist.txt"
print >> com, """
clear all proceed=yes
set mission suzaku
set datadir /Volumes/Macintosh_HD_2/Nobackup/aepipeline//801040010/
"""
print >> com, "read events @"+ev_file+'¥n'
print >> com, """
ext image
save image test1.xy
"""
print out_com, "is created¥n"
com.close
# open file into string
com = open(out_com, 'r')
# com_list = com.readlines()
# TypeError: must be string or buffer, not list
# to list
com_str = com.read()
xsp = subprocess.Popen( 'xselect', stdin = subprocess.PIPE )
xsp.stdin.write( '¥n¥n' )
xsp.stdin.write( com_str )
xsp.stdin.write( 'quit ¥n ¥n' )
xsp.wait()
#!/usr/bin/env python
"""
2012-05-25
test
http://aidememoirehu.blogspot.jp/search/label/Python
"""
MY_NAME = "run_xselect2"
import sys
import os
import subprocess
out_name = 'test' + MY_NAME
out_com = out_name+'.com'
# if out_com is already present
# overwrite
com = open (out_com, 'w')
ev_file = "test_evlist.txt"
print >> com, """
clear all proceed=yes
set mission suzaku
set datadir /Volumes/Macintosh_HD_2/Nobackup/aepipeline//801040010/
"""
print >> com, "read events @"+ev_file+'¥n'
print >> com, """
ext image
save image test1.xy
"""
print out_com, "is created¥n"
com.close
# open file into string
com = open(out_com, 'r')
# com_list = com.readlines()
# TypeError: must be string or buffer, not list
# to list
com_str = com.read()
xsp = subprocess.Popen( 'xselect', stdin = subprocess.PIPE )
xsp.stdin.write( '¥n¥n' )
xsp.stdin.write( com_str )
xsp.stdin.write( 'quit ¥n ¥n' )
xsp.wait()
ラベル:
100+access,
100access,
popular,
python,
xselect
2012年5月16日水曜日
素粒子
素粒子の世界
自分の体,
身の回りのいろいろな物,
地球,そして宇宙は何からできているのだろう?
この謎を,多くの人々が探求してきた。
これに答えるには,物理の法則と素粒子の成り立ちを理解する必要がある。
四つの力は統一できるのだろうか?
クオークやレプトンはそれ以上,分解できないだろうか?
究極の理論はどんな数学で記述できろだろうか?
この広大な宇宙も実はいくつかの素粒子で作られている。
ラベル:
high-energy-physics,
kek,
physics,
popular
2012年5月13日日曜日
2012年5月11日金曜日
2012年5月10日木曜日
登録:
投稿 (Atom)