• 検索結果がありません。

20170615

N/A
N/A
Protected

Academic year: 2017

シェア " 20170615"

Copied!
8
0
0

読み込み中.... (全文を見る)

全文

(1)

2017 年度計算数学

第10回 6/15 Shell Script

⼀井信吾

[email protected]

@si007a

(2)

Contents

1. 業務連絡 2. Shell Script

3. Shell Script 使 う 4. 正規表現

5. AWK

6. 本⽇ 実習 7. 次回予告

業務連絡

定例Windows Update

今回 緊急 多数あ ま

• Office対象 多い

(3)

Shell Script

• Script = 台本

中⾝ シ 実⾏

• Unix / Linux コ ン

実⾏可能属性 与え

名=コ ン 名

下 順次実⾏

嬉 い

何度 繰 返

作業⼿順 記録

コ ン 打 間違い防⽌

$ cat > hello echo hello

uname pwd

^D

$ chmod +x hello

$ ./hello hello

Linux

/home/ichii

(4)

Shell Script 使 う

• 21世紀 Unix / Linux 使う shell script

⾔う⼈ あ

• cf. Windows PowerShell

プロ 機能

制御構造

変数

既存 コ ン 部品 使う

#! /bin/bash

fortune="大吉 中吉 小吉

半吉 末吉 末小吉 凶 小凶 半 凶 末凶 大凶

a=($fortune) n=${#a[*]}

r=$((RANDOM % $n))

echo 今日 運勢 ${a[$r]} exit 0

(5)

正規表現

• Regular expression

正則表現 ⽅ いい

決ま ⽂法

え パターン 合致

⽂字列 表

変化 満 世 中 情報

扱う ⼤変助け ま

注意

• 正規表現 扱うUnixコ ン

• grep ... g/re/p

キス ⽂字列 探 フ

正規表現 与え パターン 検索

• sed ... stream editor

⽂字列 流 stream ⼊⼒

正規表現 ッチ ⽂字列 探

そ ⽂字列 指定 変更 加 edit

(6)

AWK

作者: Aho, Weinberger, Kernighan

区切 キス

ータ 処理

⾏内 複数フ ー ータ 処理 便利

標準装備

shell script 重宝

い 速 いけ

⼀井 結構好

(7)

本⽇ 実習

• Linux⼊⾨編最終回

う 各⾃ や ⽅

進 い

• Shell Script

• Linux標準教科書第9章 シ

実習資料集 丁寧 説明 いま

9.7 実際 シ Ubuntu

正規表現

• Linux標準教科書 4.5 grepコ

記載 あ ま

正規表現 ソフ

若⼲違い あ ま

• Web検索 ⾊々情報 あ

あま 深⼊

(8)

次回予告

次回以降2回 わ プ ⾔語 扱いま

本格的

プロ ン ⼿軽 ⾏

えま

⾊々流⾏ あ ま

宗教戦争 関与 ませ

参照

関連したドキュメント

(The Elliott-Halberstam conjecture does allow one to take B = 2 in (1.39), and therefore leads to small improve- ments in Huxley’s results, which for r ≥ 2 are weaker than the result

[r]

“Breuil-M´ezard conjecture and modularity lifting for potentially semistable deformations after

lines. Notice that Theorem 4 can be reformulated so as to give the mean harmonic stability of the configuration rather than that of the separate foliations. To this end it is

S., Oxford Advanced Learner's Dictionary of Current English, Oxford University Press, Oxford

this to the reader. Now, we come back to the proof of Step 2. Assume by contradiction that V is not empty.. Let u be the minimal solution with the given boundary values and let P be

At the end of the section, we will be in the position to present the main result of this work: a representation of the inverse of T under certain conditions on the H¨older

支払方法 支払日 ※② 緊急時連絡先等 ※③.