るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

ライブラリ

クラス

キーワード

検索結果

<< 1 2 > >>

Shell.def_system_command(command, path = command) -> nil (21125.0)

Shell のメソッドとして command を登録します.

...
Sh
ell のメソッドとして command を登録します.

OS上のコマンドを実行するにはまず, Shellのメソッドとして定義します.
注) コマンドを定義しなくとも直接実行できる Shell#system コマンドもあります.

@param command Shell のメソッド...
...場合はcommand と同じになります。

例)
require 'shell'
Sh
ell.def_system_command "ls"
# ls を定義

Sh
ell.def_system_command "sys_sort", "sort"
# sortコマンドをsys_sortとして定義

sh
= Shell.new
sh
.transact {
ls.each { |l|
puts l
}
(ls("-l") | s...

Shell::CommandProcessor.def_system_command(command, path = command) -> () (21101.0)

@todo

@todo

与えられたコマンドをメソッドとして定義します。

@param command 定義したいコマンドを指定します。

@param path command のパスを指定します。省略すると環境変数 PATH から command を探します。

Shell.undef_system_command(command) -> Shell::CommandProcessor (9218.0)

commandを削除します.

...するコマンドの文字列を指定します。

動作例:
require 'shell'
Sh
ell.def_system_command("ls")
# ls を定義
Sh
ell.undef_system_command("ls")
# ls を 削除

sh
= Shell.new
begin
sh
.transact {
ls("-l").each {|l|
puts l
}
}
rescue NameEr...

Shell::CommandProcessor.undef_system_command(command) -> self (9100.0)

与えられたコマンドを削除します。

与えられたコマンドを削除します。

@param command 削除したいコマンド名を指定します。

Shell#system(command, *opts) -> Shell::SystemCommand (3130.0)

command を実行する.

...で指定します。

@param opts command のオプションを文字列で指定します。複数可。

使用例:

require 'shell'
Sh
ell.verbose = false
sh
= Shell.new

print sh.system("ls", "-l")
Sh
ell.def_system_command("head")
sh
.system("ls", "-l") | sh.head("-n 3") > STDOUT...

絞り込み条件を変える

Shell::CommandProcessor#system(command, *opts) -> Shell::SystemCommand (3130.0)

command を実行する.

...で指定します。

@param opts command のオプションを文字列で指定します。複数可。

使用例:

require 'shell'
Sh
ell.verbose = false
sh
= Shell.new

print sh.system("ls", "-l")
Sh
ell.def_system_command("head")
sh
.system("ls", "-l") | sh.head("-n 3") > STDOUT...

Shell::Filter#system(command, *opts) -> Shell::SystemCommand (3130.0)

command を実行する.

...で指定します。

@param opts command のオプションを文字列で指定します。複数可。

使用例:

require 'shell'
Sh
ell.verbose = false
sh
= Shell.new

print sh.system("ls", "-l")
Sh
ell.def_system_command("head")
sh
.system("ls", "-l") | sh.head("-n 3") > STDOUT...

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

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

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

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

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

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

....

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

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

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

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

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

動作例
require 'shell'
Sh
ell.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...

絞り込み条件を変える

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

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

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

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

Shell::CommandProcessor#cat(*files) -> Shell::Filter (3118.0)

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

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

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

Shell::CommandProcessor#echo(*strings) -> Shell::Filter (3118.0)

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

....

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

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

Shell::CommandProcessor#glob(pattern) -> Shell::Filter (3118.0)

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

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

動作例
require 'shell'
Sh
ell.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...

Shell::CommandProcessor#tee(file) -> Shell::Filter (3118.0)

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

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

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

絞り込み条件を変える

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

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

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

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

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

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

....

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

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