revTalk CGI 06: UNIX のコマンドラインを使う
表示サンプル


UNIX, LINUX のコマンドラインを、shell を使って MacOS X のターミナルのように使います。


-- コマンドライン「date」のアウトプットを「tDate」に入れる --
put shell("date") into tData
replaceToBR tData

-- revTalk で得たテキストラインの改行を、 html 用に変えるコマンド --
command replaceToBR pData
  replace cr with "<br \>" &cr in pData
  put pData & "<br \>"
end replaceToBR



コマンドラインが何行かある場合は、各行を「cr」で繋ぎます。
irev ファイルと同じ階層にある、「main」フォルダーのファイルリストを書き出すコマンドライン。


put ("cd main" &cr& "ls") into tCommand
put shell(tCommand) into tData
replaceToBR tData



shell のコマンドラインと同じような内要を、 revTalk のスクリプトで書いて参照で付けました。


-- revTalk を使った、サーバーの日付と GMT との時差 --
put the internet date & "<br \><br \>"


-- revTalk を使った、mainフォルダー内のファイル・リスト --
set the defaultFolder to the folder &"/main/"
put the files into tFiles
replaceToBR tFiles