まずはExpectの紹介。
サーバ管理業務・開発業務での自動化を行うとき、telnetやftpが必要になったところで、断念したりターミナルソフトのマクロ機能を使ったりしたことは無いでしょうか?
ターミナルソフトのマクロのようなスクリプト言語は無いのでしょうか?
あります。日本語書籍で紹介されていないだけです。
Expectでftpの処理を、マクロ風に書くならこんな感じです。
---
#! /usr/bin/expect
spawn ftp ftp.xx.com
expect "Name"
send "anonymous¥r"
---
通信NG時の処理を加えるなら以下のようになります。
---
#! /usr/bin/expect
spawn ftp ftp.xx.com
expect {
"Name" {send "anonymous¥r"}
"unknown host" exit
" Connection refused" exit
}
---
Expectは一般的なターミナルマクロに対して、特に以下の点が優れています。
・正規表現による文字列監視が可能
・複数プロセスの同時監視が可能
・一時的なユーザ入力処理の管理が可能
・C/C++へのライブラリがある
本書は、このExpectの全般を網羅する唯一の書籍です。
洋書ですからもちろん英語ですが、比較的平易ですし、man は日本語がありますので、挑戦してみる価値はあります。
ExpectはTclをベースとしているため、Tclの言語知識が必要ですが、本書では一つの章でこれの説明を記載しています。
会話側処理の自動化を目指す方にお勧めです。
¥6,565¥6,565 税込
ポイント: 66pt
(1%)
配送料 ¥257 6月23日-7月4日にお届け
発送元: SuperBookDeals_ 販売者: SuperBookDeals_
¥6,565¥6,565 税込
ポイント: 66pt
(1%)
配送料 ¥257 6月23日-7月4日にお届け
発送元: SuperBookDeals_
販売者: SuperBookDeals_
¥3,263¥3,263 税込
ポイント: 33pt
(1%)
配送料 ¥257 6月22日-7月3日にお届け
発送元: Paper Cavalier JP 販売者: Paper Cavalier JP
¥3,263¥3,263 税込
ポイント: 33pt
(1%)
配送料 ¥257 6月22日-7月3日にお届け
発送元: Paper Cavalier JP
販売者: Paper Cavalier JP
無料のKindleアプリをダウンロードして、スマートフォン、タブレット、またはコンピューターで今すぐKindle本を読むことができます。Kindleデバイスは必要ありません。
ウェブ版Kindleなら、お使いのブラウザですぐにお読みいただけます。
携帯電話のカメラを使用する - 以下のコードをスキャンし、Kindleアプリをダウンロードしてください。
Exploring Expect: A Tcl-Based Toolkit for Automating Interactive Programs ペーパーバック – 1995/1/10
英語版
Don Libes
(著)
ダブルポイント 詳細
{"desktop_buybox_group_1":[{"displayPrice":"¥6,565","priceAmount":6565.00,"currencySymbol":"¥","integerValue":"6,565","decimalSeparator":null,"fractionalValue":null,"symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"mu9vNbOicW%2Fg%2B6vhTSBuzXogt%2FCujkcAwiNGDGpvkKqGZVfRsXMM3KeszlzePtIfAbbtpg3gTRt4J1rsNpCGA7%2FQ8e%2BePT1YUZX7pgzZWi%2Fck73hBRfQuEMFjJ3DR7YjzC3pC8VFn6EFrZK76SgnVgXTJ3BQh0yLuXp9T%2Fxgfb%2F5jk3IdOwU0mWZeclog3dD","locale":"ja-JP","buyingOptionType":"NEW","aapiBuyingOptionIndex":0}, {"displayPrice":"¥3,263","priceAmount":3263.00,"currencySymbol":"¥","integerValue":"3,263","decimalSeparator":null,"fractionalValue":null,"symbolPosition":"left","hasSpace":false,"showFractionalPartIfEmpty":true,"offerListingId":"mu9vNbOicW%2Fg%2B6vhTSBuzXogt%2FCujkcAZlvNgRN6W2Ru84I7YPPl%2BfeKUrq3E2tiMS1XqeWuf%2FPT9aS98ZiOEbuaVJXFUyWtJCoz3NZPhixVXN4DRxycBbi7mJbc8I9KTMs84UqHQOcDd5p7FdTe%2Febf%2FRyZfd6GYrsALzwLYTKSmzYqn514sQ%3D%3D","locale":"ja-JP","buyingOptionType":"USED","aapiBuyingOptionIndex":1}]}
購入オプションとあわせ買い
Expect is quickly becoming a part of every UNIX user's toolbox. It allows you to automate Telnet, FTP, passwd, rlogin, and hundreds of other applications that normally require human interaction. Using Expect to automate these applications will allow you to speed up tasks and, in many cases, solve new problems that you never would have even considered before. For example, you can use Expect to test interactive programs with no changes to their interfaces. Or wrap interactive programs with Motif-like front-ends to control applications by buttons, scrollbars, and other graphic elements with no recompilation of the original programs. You don't even need the source code! Expect works with remote applications, too. Use it to tie together Internet applications including Telnet, Archie, FTP, Gopher, and Mosaic. Don Libes is the creator of Expect as well as the author of this book. In Exploring Expect, he provides a comprehensive tutorial on all of Expect's features, allowing you to put it immediately to work on your problems. In a down-to-earth and humorous style, he provides numerous examples of challenging real-world applications and how they can be automated using Expect to save you time and money. Expect is the first of a new breed of programs based on Tcl, the Tool Command Language that is rocking the computer science community. This book provides an introduction to Tcl and describes how Expect applies Tcl's power to the new field of interaction automation. Whether your interest is in Expect or interaction automation or you simply want to learn about Tcl and see how it has been used in real software, you will find Exploring Expect a treasure trove of easy-to-understand and valuable information.
- 本の長さ602ページ
- 言語英語
- 出版社O'Reilly Media
- 発売日1995/1/10
- 寸法17.78 x 3.3 x 23.34 cm
- ISBN-109781565920903
- ISBN-13978-1565920903
商品の説明
出版社からのコメント
Expect is quickly becoming a part of every UNIX user's toolbox. It allows you to automate Telnet, FTP, passwd, rlogin, and hundreds of other applications that normally require human interaction. Using Expect to automate these applications will allow you to speed up tasks and, in many cases, solve new problems that you never would have even considered before. For example, you can use Expect to test interactive programs with no changes to their interfaces. Or wrap interactive programs with Motif-like front-ends to control applications by buttons, scrollbars, and other graphic elements with no recompilation of the original programs. You don't even need the source code! Expect works with remote applications, too. Use it to tie together Internet applications including Telnet, Archie, FTP, Gopher, and Mosaic. Don Libes is the creator of Expect as well as the author of this book. In Exploring Expect, he provides a comprehensive tutorial on all of Expect's features, allowing you to put it immediately to work on your problems. In a down-to-earth and humorous style, he provides numerous examples of challenging real-world applications and how they can be automated using Expect to save you time and money. Expect is the first of a new breed of programs based on Tcl, the Tool Command Language that is rocking the computer science community. This book provides an introduction to Tcl and describes how Expect applies Tcl's power to the new field of interaction automation. Whether your interest is in Expect or interaction automation or you simply want to learn about Tcl and see how it has been used in real software, you will find Exploring Expect a treasure trove of easy-to-understand and valuable information.
著者について
Don Libes is married to Susan Mulroney, a professor in the Department of Physiology and Biophysics at the Georgetown University School of Medicine. Sue performs research in the area of kidney growth and development. Their well-hydrated daughter, Kenna, has two lovely kidneys.
登録情報
- ASIN : 1565920902
- 出版社 : O'Reilly Media; 第1版 (1995/1/10)
- 発売日 : 1995/1/10
- 言語 : 英語
- ペーパーバック : 602ページ
- ISBN-10 : 9781565920903
- ISBN-13 : 978-1565920903
- 寸法 : 17.78 x 3.3 x 23.34 cm
- Amazon 売れ筋ランキング: - 271,523位洋書 (洋書の売れ筋ランキングを見る)
- - 97位Unix Operating System
- - 1,222位Software Development
- - 2,607位Computer Programming Language & Tool
- カスタマーレビュー:
著者について
著者をフォローして、新作のアップデートや改善されたおすすめを入手してください。
著者の本をもっと発見したり、よく似た著者を見つけたり、著者のブログを読んだりしましょう
カスタマーレビュー
星5つ中4.3つ
5つのうち4.3つ
全体的な星の数と星別のパーセンテージの内訳を計算するにあたり、単純平均は使用されていません。当システムでは、レビューがどの程度新しいか、レビュー担当者がAmazonで購入したかどうかなど、特定の要素をより重視しています。 詳細はこちら
59グローバルレーティング
虚偽のレビューは一切容認しません
私たちの目標は、すべてのレビューを信頼性の高い、有益なものにすることです。だからこそ、私たちはテクノロジーと人間の調査員の両方を活用して、お客様が偽のレビューを見る前にブロックしています。 詳細はこちら
コミュニティガイドラインに違反するAmazonアカウントはブロックされます。また、レビューを購入した出品者をブロックし、そのようなレビューを投稿した当事者に対して法的措置を取ります。 報告方法について学ぶ
他の国からのトップレビュー
Jesus M.A
5つ星のうち5.0
Todo correcto
2017年8月18日にスペインでレビュー済みAmazonで購入
El libro está en muy buen estado, el envío rápido. Todo perfecto.
Buscando formas práctica de automatizar sesiones telnet descubrí Spec. Espero q me sea muy útil
Buscando formas práctica de automatizar sesiones telnet descubrí Spec. Espero q me sea muy útil
Saulo Paiva
5つ星のうち5.0
Five Stars
2014年10月2日に英国でレビュー済みAmazonで購入
Got my problems at work resolved in 2 weeks with Expect. The book helped me a lot!
amazonian
5つ星のうち5.0
Excellent piece of work by Don
2014年5月7日にインドでレビュー済みAmazonで購入
Excellent introduction to several aspects of expect. Lots of introductory material, and few advanced topics too. Don has paced it very well.
Robert S. Truesdell
5つ星のうち5.0
Good examples, good index, good explanations
1998年5月21日にアメリカ合衆国でレビュー済みAmazonで購入
This book, along with Ousterhout and Sun's references on the www, comprise the triolgy that is jump-starting my learning tcl. I find the index compete and easy to use and I frequently jump all around the book gleaning little nuggets of information. I am also concurrently reading it cover-to-cover because I like Libes's style -- the way he throws in his programming phylosophy with his examples so you can see why he's doing something a certain way.
I like how the author addresses issues of portability without obsessing on it.
I really like the Exercises at the end of each chapter. I only wish the author would apply a difficulty rating to each exercise because sometimes I can't tell if an exercise is intrinsically very difficult (some are definitely so) or if I need to review parts of the chapter to see why I can't just instantly 'get it.' In any event, the exercises are stimulating and would require a long time and careful thought to do them all. I would buy a book that had the answers, with commentary, to all the exercises.
I like how the author addresses issues of portability without obsessing on it.
I really like the Exercises at the end of each chapter. I only wish the author would apply a difficulty rating to each exercise because sometimes I can't tell if an exercise is intrinsically very difficult (some are definitely so) or if I need to review parts of the chapter to see why I can't just instantly 'get it.' In any event, the exercises are stimulating and would require a long time and careful thought to do them all. I would buy a book that had the answers, with commentary, to all the exercises.