Simple Sand Samples |
説明のないとってもシンプルなサンプルプログラム集
COBOL | awk | C言語 | D言語 | GO言語 | Lua | Vim |
bash | Perl | Gauche | Clojure | CLISP | EmacsLisp | VimScript |
tcsh | Ruby | Groovy | Java | C# | VBScript | JavaScript |
Io言語 | Python | Erlang | Scala | VB.NET | Excel/VBA | PHP |
Tcl | Haskell | OCaml | PowerShell | Windows | Unix/Linux |
Ruby > ディレクトリのファイルを再帰的に取得
find.rb
|
|
$ find ./sample_dir
./sample_dir
./sample_dir/file1
./sample_dir/dir3
./sample_dir/file2
./sample_dir/dir1
./sample_dir/dir1/dir2
./sample_dir/dir1/dir2/file21
./sample_dir/dir1/file12
./sample_dir/dir1/file11
$
$ ruby find.rb ./sample_dir
./sample_dir
./sample_dir/dir1
./sample_dir/dir1/dir2
./sample_dir/dir1/dir2/file21
./sample_dir/dir1/file11
./sample_dir/dir1/file12
./sample_dir/dir3
./sample_dir/file1
./sample_dir/file2
$
./sample_dir
./sample_dir/file1
./sample_dir/dir3
./sample_dir/file2
./sample_dir/dir1
./sample_dir/dir1/dir2
./sample_dir/dir1/dir2/file21
./sample_dir/dir1/file12
./sample_dir/dir1/file11
$
$ ruby find.rb ./sample_dir
./sample_dir
./sample_dir/dir1
./sample_dir/dir1/dir2
./sample_dir/dir1/dir2/file21
./sample_dir/dir1/file11
./sample_dir/dir1/file12
./sample_dir/dir3
./sample_dir/file1
./sample_dir/file2
$
* 確認環境 Debian Linux(jessie)