home > 比較編 > Perl, PHP, Python, Ruby > processes and environment >

ForNext

Only Do What Only You Can Do

204. external command

VBScript

JScript

Perl

system("ls -l /tmp") == 0 or
  die "ls failed";


PHP

system("ls -l /tmp", $retval);
if ($retval) {
  throw new Exception("ls failed");
}

Python

if os.system('ls -l /tmp'):
  raise Exception('ls failed')


Ruby

unless system("ls -l /tmp")
  raise "ls failed"
end

PowerShell

Scala

F#

C

C++

C++Builder

VC++

C#

Java

Objective-C

D

VB

VB.NET

Delphi

Ada

PL/SQL

T-SQL

関数型

inserted by FC2 system