るりまサーチ

最速Rubyリファレンスマニュアル検索!
30件ヒット [1-30件を表示] (0.006秒)
トップページ > クエリ:txt[x] > クラス:Shell[x]

別のキーワード

  1. resolv txt
  2. txt new
  3. txt data
  4. txt strings
  5. txt resolv

ライブラリ

キーワード

検索結果

Shell#cat(*files) -> Shell::Filter (7.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ルコマンド cat に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >>...

Shell#echo(*strings) -> Shell::Filter (7.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ngs シェルコマンド echo に与える引数を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >...

Shell#glob(pattern) -> Shell::Filter (7.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...パターンの書式については、Dir.[] を参照してください。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >...

Shell#out(dev = STDOUT, &block) -> () (7.0)

Shell#transact を呼び出しその結果を dev に出力します。

...
Shell
#transact を呼び出しその結果を dev に出力します。

@param dev 出力先をIO オブジェクトなどで指定します。

@param block transact 内部で実行するシェルを指定します。


使用例:
require 'shell'
Shell
.def_system_command("head")
sh = Shell...
....new
File.open("out.txt", "w"){ |fp|
sh.out(fp) {
system("ls", "-l") | head("-n 3")
}
}...

Shell#tee(file) -> Shell::Filter (7.0)

実行すると, それらを内容とする Filter オブジェクトを返します.

...ェルコマンドtee に与えるファイル名を文字列で指定します。

動作例
require 'shell'
Shell
.def_system_command("head")
sh = Shell.new
sh.transact {
glob("*.txt").to_a.each { |file|
file.chomp!
cat(file).each { |l|
echo(l) | tee(file + ".tee") >...

絞り込み条件を変える