unix15-script2_09.key

Size: px
Start display at page:

Download "unix15-script2_09.key"

Transcription

1 UNIX講習会 シェルスクリプト2 31/July/2015 情報管理解析室 西出 浩世

2 SGE

3 ~/unix15/sge $ cd ~/unix15/sge $ ls script* script2.sh script3.sh script4.sh ~/unix15/sge/results sam 12 $ ls results/*.sam $ rm -r results $ cp -r /usr/local/data/unix15/sge/results.

4 for script1.sh $ emacs script1.sh #!/bin/sh for sm in results/*.sam do echo ${sm} done script1.sh $ chmod +x script1.sh $./script1.sh results/ecoli.1.sam results/ecoli.10.sam results/ecoli.11.sam results/ecoli.12.sam

5 for for for in do done No do Yes for done for 1 for

6 for for f in./* do done ${f} 1 for i in do done for i in {1..10} do done 1 7 ${i} ${i} 1 10

7 if script2.sh bowtie $ less script2.sh #!/bin/sh if [ -f results/ecoli.10.sam ] then echo 'ok' else echo 'not ok' fi $ chmod +x script2.sh $./script2.sh ok

8 if if [ ] if [ ] then else fi if -> -> then if fi False if True then else if fi elif

9 if if elif False if if [ 1 ] then elif [ 2 ] then elif [ 3 ] then else fi True then elif True then else if fi False

10 if : [ ] test man test 1 -eq 2 1 -ne 2 1 -gt 2 1 -lt 2 1 -ge 2 1 -le 2 1 > 2 1 < 2 1 >= 2 1 =< 2 -n 0! 0 1 = 2 1!= 2! 1 -a 2 1, 2 1 -o 2 1, 2 -d -f -e -L -r -w -x -s 0 1 -nt ot 2 1 2

11 ~/sge/results/ 12.sam.bam samtools sam -> bam samtools view -bs example.sam > example.bam.bam

12 : basename $ basename ~/unix15/sge/results/ecoli.9.sam ecoli.9.sam $ basename ~/unix15/sge/results/ecoli.9.sam.sam ecoli.9 $ basename ~/unix15/sge/results/ecoli.10.sam 0.sam ecoli.1

13 ` ` date $ date :26:31 JST $ echo "Today is date" Today is date $ echo "Today is `date`" Today is :28:08 JST basename $ fn=`basename result/ecoli.9.sam.sam` $ echo ${fn} ecoli.9

14 basename sam -> bam samtools view -bs example.sam > example.bam results/ecoli.1.sam bam result/ecoli.1.bam $ fn=`basename results/ecoli.1.sam.sam` $ echo ${fn} ecoli.1 $ samtools view -bs results/ecoli.1.sam > results/${fn}.bam 1) 2) 1) fn ecoli.1 2) ${fn}.bam bam

15 for, basename, ` ` $ less script3.sh for sm in results/*.sam do fn=`basename ${sm}.sam` echo ${sm} ${fn} done script3.sh results.sam ${sm}, ${fn} $ chmod +x script3.sh $./script3.sh

16 for ~/unix15/sge/results/.sam.bam samtools sam -> bam samtools view -bs example.sam > example.bam script3.sh.bam results/ ecoli.1.bam ecoli.12.bam basename qsub samtools echo./script3.sh echo echo qsub script3.sh

17 #!/bin/sh for sm in results/*.sam do fn=`basename ${sm}.sam` script5.sh echo samtools view -bs ${sm} > results/${fn}.bam done $./script3.sh

18 #!/bin/sh #$ -cwd for sm in results/*.sam do fn=`basename ${sm}.sam` script5.sh samtools view -bs ${sm} > results/${fn}.bam done $ qsub script3.sh

19 ( ) $ { [ ] } $ array=("human" "mouse" "rat") $ echo ${array} human $ echo ${array[2]} rat $ echo ${array[@]} 0,,,,,,,,,,,,,,,,,,,1,,,,,,,,,,,,,,,,2 human mouse rat human mouse rat $ fl=(results/*.sam) $ echo ${fl[0]} $ fl=(`ls`) $ echo ${fl[@]} results/.sam

20 for #!/bin/sh array=(results/*.sam) for i in {1..12} do fn=`basename ${array[i-1]}.sam` echo $fn ${array[i-1]} done results.sam ${array} for i in {0..11} 1

21 #!/bin/sh #$ -t 1-12 #$ -cwd list=(`ls../rnaseq/test_fastq/`) script4.sh bowtie2 -x../rnaseq/ecoli_genome -U../rnaseq/test_fastq/${list[${SGE_TASK_ID}-1]} -S results/ecoli.${sge_task_id}.sam 0 SGE_TASK_ID 1 1 ${list[${sge_task_id}-1]}

syspro-0405.ppt

syspro-0405.ppt 3 4, 5 1 UNIX csh 2.1 bash X Window 2 grep l POSIX * more POSIX 3 UNIX. 4 first.sh #!bin/sh #first.sh #This file looks through all the files in the current #directory for the string yamada, and then prints

More information

-2 gnuplot( ) j ( ) gnuplot /shell/myscript 1

-2 gnuplot( ) j ( ) gnuplot /shell/myscript 1 -2 gnuplot( ) j 2006 05 03 2006 05 12 2006 05 09 2 ( ) gnuplot /shell/myscript 1 1 shell script Level 1 myls #!/bin/sh # nowdir= pwd # if [ -f $1 -o -z $1 ] ; then echo "Enter pass" echo "ex) myls.sh./"

More information

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV

10/ / /30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20 6. http, CGI Perl 11/27 7. ( ) Perl 12/ 4 8. Windows Winsock 12/11 9. JAV [email protected] [email protected] http://www.misojiro.t.u-tokyo.ac.jp/ tutimura/sem3/ 2002 11 20 p.1/34 10/16 1. 10/23 2. 10/30 3. ( ) 11/ 6 4. UNIX + C socket 11/13 5. ( ) C 11/20

More information

Asterisk PBX 不正利用防止

Asterisk PBX 不正利用防止 Asterisk PBX ICTR120716-OR01A Info Circus,Inc. 1 2 2 IP-PBX 3 2.1........................... 3 3 IP-PBX 4 3.1........................................... 4 3.2..................................... 4 3.3..............................

More information

1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $fi

1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $fi I 065712D : 4 1 ( ) 1.1 (convert.sh) (18GHz 26GHz) C (convert.c, convert1.c) mesure-ryudai convert.sh #!/bin/sh # file1 file1= ls -1 $1 # file1 data for data in $file1 do mkdir $data echo " $data " # file2

More information

1 1 2 65

1 1 2 65 3 3 2000 6 14 2 30 4 2 1 1 2 65 1!?? < > 3 2 2 100 19 19 100 100 100 < > 19 2 2 2 2 < > 2000 2000 50 1945 5 50 1945 5 45 20 20 4 1945 4 5 5 5 100 50 20 5 2 20 5 20 5 5 6 20 6 19 5 5 6 5 6 2 20 6 21

More information

LAN

LAN HUB 1090248 21 3 19 1 1 2 3 2.1...................................... 3 2.1.1................................ 4 2.1.2 LAN................................. 6 2.2................................... 8 3 12

More information

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2

... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 1 ... 3... 3... 3... 3... 4... 7... 10... 10... 11... 12... 12... 13... 14... 15... 18... 19... 20... 22... 22... 23 2 3 4 5 6 7 8 9 Excel2007 10 Excel2007 11 12 13 - 14 15 16 17 18 19 20 21 22 Excel2007

More information

untitled

untitled [email protected] OK CNS OS CPU HDD FDD USB 1 (CPU) (CPU) CISCPentium4(Windows PC) RISCPowerPC(Macintosh PC) CPU CPU CPU CPU CD/DVD OS 2 OS Windows MacOS ( Talk, MacOSX) UNIX Word/Excel/PowerPoint etc..

More information

38

38 3 37 38 3.1. 3.1.1. 3.1-1 2005 12 5 7 2006 5 31 6 2 2006 8 10 11 14 2006 10 18 20 3.1-1 9 00 17 3 3.1.2. 3.1-2 3.1-1 9 9 3.1-2 M- M-2 M-3 N- N-2 N-3 S- S-2 S-3 3.1.2.1. 25 26 3.1.2.2. 3.1-3 25 26 39 3.1-1

More information

シェルスクリプトマガジン vol.30

シェルスクリプトマガジン vol.30 ユニケージ開発手法 コードレビュー USP 研究所技術研究員 written by 大内智明 Vol.19 更新したファイルを相手サーバに配信する方法について説明します 今回は前回に引き続いて 店舗や商品といったマスタ 関連のファイルが どのように管理されて 各業務サー マスタ関連のファイルは 一般的に種類も多く サイズも大小様々なものがあります そこで 毎回全マスタの配信を行わないようにするために

More information

2

2 1 2 10 14 945 3000 2012 3 10 4 5 6 7 8 9 10 11 12 2011 11 21 12301430 (1215 ) 13 6 27 17 () ( ) ( ) (112360) 2 (1157) (119099) ((11861231) )( ) (11641205) 3 (1277) 3 4 (1558) (1639)() 12 (1699)( ) 7 (1722)

More information

http://banso.cocolog-nifty.com/ 100 100 250 5 1 1 http://www.banso.com/ 2009 5 2 10 http://www.banso.com/ 2009 5 2 http://www.banso.com/ 2009 5 2 http://www.banso.com/ < /> < /> / http://www.banso.com/

More information

初心者用

初心者用 初心者用 シェルスクリプト講座 第 3 版 1999 年 2 月 22 日 文責 : 斎藤輪太郎 1. はじめに この入門書では初心者向けにシェルスクリプトの書き方を解説していきます 前提として UNIX の基本的な知識とコマンド コンピュータのごく基本的な知識が身についているものとします 2. 基本的な語彙 シェル.. ユーザの意志をコンピュータに伝えるためのプログラムの一種 シェルスクリプト..

More information

HPhi_exercise.key

HPhi_exercise.key laptop PC (TPQ ) OK https://github.com/yomichi/hphi-samples 1: S =1/2 Heisenbergdimer 2 S =1/2 Heisenberg dimer model H = S 1 S 2 S tot =0 E = 3/4 S tot =1 E =1/4 HPhi 2 2/17 1: S =1/2 Heisenbergdimer

More information

n=360 28.6% 34.4% 36.9% n=360 2.5% 17.8% 19.2% n=64 0.8% 0.3% n=69 1.7% 3.6% 0.6% 1.4% 1.9% < > n=218 1.4% 5.6% 3.1% 60.6% 0.6% 6.9% 10.8% 6.4% 10.3% 33.1% 1.4% 3.6% 1.1% 0.0% 3.1% n=360 0% 50%

More information

I117 II I117 PROGRAMMING PRACTICE II SCRIPT LANGUAGE 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara

I117 II I117 PROGRAMMING PRACTICE II SCRIPT LANGUAGE 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara I117 II I117 PROGRAMMING PRACTICE II SCRIPT LANGUAGE 1 Research Center for Advanced Computing Infrastructure (RCACI) / Yasuhiro Ohara [email protected] / SCHEDULE 1. 2011/06/07(Tue) / Basic of Programming

More information

2003 10 2003.10.21 70.400 YES NO NO YES YES NO YES NO YES NO YES NO NO 20 20 50m 12m 12m 0.1 ha 4.0m 6.0m 0.3 ha 4.0m 6.0m 6.0m 0.3 0.6ha 4.5m 6.0m 6.0m 0.6 1.0ha 5.5m 6.5m 6.0m 50m 18 OK a a a a b a

More information

X Window System X X &

X Window System X X & 1 1 1.1 X Window System................................... 1 1.2 X......................................... 1 1.3 X &................................ 1 1.3.1 X.......................... 1 1.3.2 &....................................

More information

CM-3G 周辺モジュール拡張技術文書 INA226センサ(電流、電圧、電力)

CM-3G 周辺モジュール拡張技術文書 INA226センサ(電流、電圧、電力) CM-3G 周辺モジュール拡張技術文書 INA226 センサ ( 電流 電圧 電力 ) ( 第 1 版 ) Copyright (C)2015 株式会社コンピューテックス 目次 1. はじめに... 1 2. INA226 について... 1 3. 接続図... 1 4. buildroot へのパッチと make 方法... 2 5. シェル スクリプト... 3 6. シェル スクリプトの実行...

More information

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2

Windows Cygwin Mac *1 Emacs Ruby ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 September 2016 1 Windows Cygwin Mac *1 Emacs Ruby 1 1.1 ( ) 1 Cygwin Bash Cygwin Windows Cygwin Cygwin Mac 1 Mac 1.2 *2 ls *3 *1 OS Linux *2 *3 Enter ( ) 2 ~/16:00:20> ls 2 2 ls ls -a ~/16:00:20> ls -a

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション 計算機実習 Ⅰ FORTRAN 担当 2018.05.29 本日の課題 プログラムの基本ルールを理解し 以下が含まれるプログラムを作成する (1) 文法の基礎 ( フローチャートなど ) (2) 変数宣言 (3) 入出力 (4) 四則演算 (5) 組込関数 (6) 判定文 (7) リダイレクション PROGRAM MAIN INTEGER I, J, K REAL A, B, C CHARACTER

More information

項 目

項 目 1 1 2 3 11 4 6 5 7,000 2 120 1.3 4,000 04 450 < > 5 3 6 7 8 9 4 10 11 5 12 45 6 13 E. 7 B. C. 14 15 16 17 18 19 20 21 22 23 8 24 25 9 27 2 26 6 27 3 1 3 3 28 29 30 9 31 32 33 500 1 4000 0 2~3 10 10 34

More information

<4D F736F F F696E74202D E3F FC96E55F F554E CC8AEE D8EAF2E B8CDD8AB B83685D>

<4D F736F F F696E74202D E3F FC96E55F F554E CC8AEE D8EAF2E B8CDD8AB B83685D> 大規模計算機システム利用講習会スーパーコンピュータ利用入門 大阪大学サイバーメディアセンター大規模計算研究部門吉野元 [email protected] 参考資料 大規模計算機システム利用講習会スーパーコンピュータ利用入門 (2013 年 9 月 10 日 ) 大阪大学サイバーメディアセンター大阪大学情報推進部情報基盤課研究系システム班 パソコン& スーパーコンピュータで計算するための基礎知識

More information

GNU Emacs GNU Emacs

GNU Emacs GNU Emacs GNU Emacs 2015 10 2 1 GNU Emacs 1 1.1....................................... 1 1.2....................................... 1 1.2.1..................................... 1 1.2.2.....................................

More information

17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) (1) (3) 25. (1) (3) 26. (1) 27. (1) (3) 28. (1) 29. (1) 2

17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) (1) (3) 25. (1) (3) 26. (1) 27. (1) (3) 28. (1) 29. (1) 2 1. (1) 2. 2 (1) 4. (1) 5. (1) 6. (1) 7. (1) 8. (1) 9. (1) 10. (1) 11. (1) 12. (1) 13. (1) 14. (1) 15. (1) (3) 16. (1) 1 17. (1) 18. (1) 19. (1) 20. (1) 21. (1) (3) 22. (1) (3) 23. (1) (3) 24. 1 (1) (3)

More information

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb

●70974_100_AC009160_KAPヘ<3099>ーシス自動車約款(11.10).indb " # $ % & ' ( ) * +, -. / 0 1 2 3 4 5 6 7 8 9 : ; < = >? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y " # $ % & ' ( ) * + , -. / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B

More information

Samba_HowTo.doc

Samba_HowTo.doc Samba 3.0.0 on CLUSTERPRO for Linux HowTo 1 Linux Samba CLUSTERPRO for Linux Samba Linux Samba Samba Samba 2 Samba Red Hat Enterprise Linux AS release 3 CLUSTERPRO SE for Linux Ver3.0 Samba 3.0.0-14.3

More information

untitled

untitled 280 200 5 7,800 6 8,600 28 1 1 18 7 8 2 ( 31 ) 7 42 2 / / / / / / / / / / 1 3 (1) 4 5 3 1 1 1 A B C D 6 (1) -----) (2) -- ()) (3) ----(). ()() () ( )( )( )( ) ( ) ( )( )( )( ) () (). () ()() 7 () ( ) 1

More information

プリント

プリント 130 100 70 100 127% ECO.R IS 300 200 100 100 280% 0 ECO.R IS 120% 120 100 100 80 new ECO.R LS 121% 120 127% 100 100 80 new ECO.R LS ECO.R LS 130% 130 100 100 70 ECO.R LS 120 100 80 100 116% 122% new ECO.R

More information

コンピュータ概論

コンピュータ概論 5.1 VBA VBA Check Point 1. 2. 5.1.1 ( bug : ) (debug) On Error On Error On Error GoTo line < line > 5.1.1 < line > Cells(i, j) i, j 5.1.1 MsgBox Err.Description Err1: GoTo 0 74 Visual Basic VBA VBA Project

More information

I #2 : ( 8-13), () URL : j inoue/prog2007/prog2007.html

I #2 : ( 8-13), () URL :  j inoue/prog2007/prog2007.html Title 計算機プログラミング I 同演習講義ノート 2007 Author(s) 井上, 純一 Citation Issue Date 2007-08-22T04:23:05Z DOI Doc URLhttp://hdl.handle.net/2115/28047 Right Type learningobject Additional There are other files related

More information

USP MAGAZINE 2014 August

USP MAGAZINE 2014 August ユニケージ開発手法 コードレビュー USP 研究所技術研究員 written by 大内智明 Vol.5 今回は 6 7 月号と続けて取り上げたテーマ 集中して発生するトランザクションの処理方法 に関する記事の最終回となります ユニケージ開発手法における配信用 LV3データを他サーバーへ配信する処理についてご説明します ポータルサーバーへ配信 まずは 本ページの図 1 をご覧ください 本部や店舗で発生したトランザクションを集積して

More information

PowerPoint プレゼンテーション

PowerPoint プレゼンテーション V1 シェルスクリプト入門 本講義にあたって テキストが穴埋めになっています 埋めて完成させてください クイズがたくさんあります めざせ全問正解 実習がたくさんあります とにかく書いてみるのが理解の早道です 2 シェルスクリプトが導く 明るい未来 3 シェルスクリプトが導く明るい未来 あなたは解析担当者です 今は朝の10時です 共同研究者から一本の電話がかかって きました 例の解析結果が急に必要になったので

More information

273? C

273? C TSG Theoretical Science Group 273? C 2-1.................................. 2 -1. Windows Mac Mac UNIX CUI bash >_ Finder TSG No.273? 2 3 pwd ls cd ( ) change directory 3 TSG No.273? cd hoge cd hoge cd....../

More information

2009 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA

2009 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA 2009 D 1 1.1 1.2 Pascal CASL II ( ) Pascal 1. 2009 10 15 2010 1 29 16 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA [email protected] TA [email protected] [email protected]

More information

PowerPoint Presentation

PowerPoint Presentation 大規模計算機システム利用講習会スーパーコンピュータ利用入門 大阪大学サイバーメディアセンター大規模計算研究部門吉野元 [email protected] 参考資料 大規模計算機システム利用講習会スーパーコンピュータ利用入門 (2013 年 9 月 10 日 ) 大阪大学サイバーメディアセンター大阪大学情報推進部情報基盤課研究系システム班 2 目 次 UNIX 環境を利用するための基礎知識

More information

2011 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA enshu-

2011 D Pascal CASL II ( ) Pascal C 3. A A Pascal TA TA enshu- 2011 D 1 1.1 1.2 Pascal CASL II ( ) Pascal 1. 2011 10 6 2011 2 9 15 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA [email protected] TA [email protected] [email protected]

More information

Emacs Ruby..

Emacs Ruby.. command line editor 27014533 2018 3 1 5 1.1................................... 5 1.2................................... 5 2 6 2.1 Emacs...................................... 6 2.2 Ruby.......................................

More information

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA

2005 D Pascal CASL ( ) Pascal C 3. A A Pascal TA TA TA 2005 D 1 1.1 1.2 Pascal CASL ( ) Pascal 1. 2005 10 13 2006 1 19 12 2. C 3. A A 2 1 2 Pascal 1.3 1. 2. TA TA TA [email protected] [email protected] [email protected] [email protected]

More information

情報の分析 1. Linux ツールの活用

情報の分析 1. Linux ツールの活用 1. Linux Chris Plaintail June 16, 2016 1 / 39 1 Cygwin Cygwin 2 3 4 Cygwin 5 2 / 39 Uinux Unix OS Micorsoft Windows Cygwin Cygwin 3 / 39 Cygwin 4 / 39 Cygwin...is it? a large collection of GNU and Open

More information

2

2 1 2 119 119 5 500 1 30 102 1 113 3 4 120 2 3 113 5 230 1 1 3 4 5 6 7 8 1 [email protected] 2 9 3 ( ) 10 11 12 4 1. 2. 3. 4. 13 5 14 15 16 17 18 19 [ ] [ ] 20 [ ] [ ] [ ] 21 22 [ ] 23 < > < >

More information