るりまサーチ

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

別のキーワード

  1. _builtin -
  2. open-uri open
  3. irb/input-method new
  4. irb/input-method gets
  5. matrix -

検索結果

<< 1 2 3 ... > >>

Shell#chown(owner, group, *filename) -> Integer (113.0)

File クラスにある同名のクラスメソッドと同じです.

...er chown(2) と同様に数値で指定します。nil または -1 を指定することで、オーナーを現在のままにすることができます。

@param group chown(2) と同様に数値で指定します。nil または -1 を指定することで、グループを現在のままに...

Shell.alias_command(alias, command, *opts) {...} -> self (113.0)

コマンドの別名(エイリアス)を作成します。 コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

...コマンドの別名(エイリアス)を作成します。
コマンドが無い場合は、Shell.def_system_command などであらかじめ作成します.

@param alias エイリアスの名前を文字列で指定します.

@param command コマンド名を文字列で指定します.

@param...
...を指定します.

使用例: ls -la | sort -k 5 のような例。

require 'shell'
Shell
.def_system_command("ls")
Shell
.alias_command("lsla", "ls", "-a", "-l")
Shell
.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}...

Shell.install_system_commands(pre = "sys_") -> () (113.0)

system_path上にある全ての実行可能ファイルをShellに定義する. メソッ ド名は元のファイル名の頭にpreをつけたものとなる.

...イルをShellに定義する. メソッ
ド名は元のファイル名の頭にpreをつけたものとなる.

@param pre Shellに定義するメソッド名の先頭に付加される文字列を指定します。

使用例: ls -l | head -n 5 のような例。

require 'shell'
Shell
.install...
..._system_commands
sh = Shell.new
sh.verbose = false
sh.transact {
(sys_ls("-l") | sys_head("-n 5")).each {|l|
puts l
}
}...

Shell.unalias_command(alias) -> () (113.0)

commandのaliasを削除します.

...使用例: ls -la | sort -k 5 のような例。
require 'shell'
Shell
.def_system_command("ls")
Shell
.alias_command("lsla", "ls", "-a", "-l")
Shell
.def_system_command("sort")
sh = Shell.new
sh.transact {
(lsla | sort("-k 5")).each {|l|
puts l
}
}
Shell
.unalias_command...
...("lsla")
begin
Shell
.unalias_command("lsla")
rescue NameError => err
puts err
end...

Shell#[](command, file1, file2 = nil) -> bool | Time | Integer | nil (101.0)

Kernel.#test や FileTest のメソッドに処理を委譲します。

...ァイルへのパスを指定します。

@param file2 文字列でファイルへのパスを指定します。

require 'shell'
Shell
.verbose = false
sh = Shell.new
begin
sh.mkdir("foo")
rescue
end
p sh[?e, "foo"] # => true
p sh[:e, "foo"] # => true
p sh["e"...

絞り込み条件を変える

Shell#append(to, filter) -> Shell::AppendFile | Shell::AppendIO (101.0)

@todo

...@todo

@param to 文字列か IO を指定します。

@param filter Shell::Filter のインスタンスを指定します。...

Shell#atime(filename) -> Time (101.0)

File クラスにある同名のクラスメソッドと同じです.

File クラスにある同名のクラスメソッドと同じです.

@param filename ファイル名を表す文字列か IO オブジェクトを指定します。

@see File.atime

Shell#basename(filename, suffix = "") -> String (101.0)

File クラスにある同名のクラスメソッドと同じです.

File クラスにある同名のクラスメソッドと同じです.

@param filename ファイル名を表す文字列を指定します。

@param suffix サフィックスを文字列で与えます。'.*' という文字列を与えた場合、'*' はワイルドカードとして働き
'.' を含まない任意の文字列にマッチします。

@see File.basename

Shell#blockdev?(file) -> bool (101.0)

FileTest モジュールにある同名のクラスメソッドと同じです.

FileTest モジュールにある同名のクラスメソッドと同じです.

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@see FileTest.#blockdev?

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

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

...@param files シェルコマンド 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) | te...

絞り込み条件を変える

Shell#cd(path, &block) -> self (101.0)

カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.

...レクトリを文字列で指定します.

@param block path で指定したディレクトリで行う操作をブロックで指定します.

使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}...

Shell#chardev?(file) -> bool (101.0)

FileTest モジュールにある同名のクラスメソッドと同じです.

FileTest モジュールにある同名のクラスメソッドと同じです.

@param file ファイル名を表す文字列か IO オブジェクトを指定します。

@see FileTest.#chardev?

Shell#chdir(path, &block) -> self (101.0)

カレントディレクトリをpathにする. イテレータとして呼ばれたときには ブロック実行中のみカレントディレクトリを変更する.

...レクトリを文字列で指定します.

@param block path で指定したディレクトリで行う操作をブロックで指定します.

使用例
require 'shell'
sh = Shell.new
sh.transact {
cd("/tmp"){
p cwd #=> "/tmp"
}
p cwd #=> "/Users/kouya/rbmanual"
}...

Shell#chmod(mode, *filename) -> Integer (101.0)

File クラスにある同名のクラスメソッドと同じです.

File クラスにある同名のクラスメソッドと同じです.

@param filename ファイル名を表す文字列を指定します。

@param mode chmod(2) と同様に整数で指定します。

@see File.chmod

Shell#command_processor -> Shell::CommandProcessor (101.0)

@todo

@todo

絞り込み条件を変える

Shell#concat(*jobs) -> Shell::Concat (101.0)

@todo

@todo

Shell#ctime(filename) -> Time (101.0)

File クラスにある同名のクラスメソッドと同じです.

File クラスにある同名のクラスメソッドと同じです.

@param filename ファイル名を表す文字列か IO オブジェクトを指定します。

@see File.ctime
<< 1 2 3 ... > >>