run-and-write-if-okay revision 4632
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# This code is free software; you can redistribute it and/or modify it
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# under the terms of the GNU General Public License version 2 only, as
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# published by the Free Software Foundation. Oracle designates this
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# particular file as subject to the "Classpath" exception as provided
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# by Oracle in the LICENSE file that accompanied this code.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# This code is distributed in the hope that it will be useful, but WITHOUT
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# version 2 for more details (a copy is included in the LICENSE file that
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# accompanied this code).
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# You should have received a copy of the GNU General Public License version
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# 2 along with this work; if not, write to the Free Software Foundation,
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
a9478106a12424322498e53cf7cd75bd8a4d6004Yuri Pankov# or visit www.oracle.com if you need additional information or have any
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweExpects two args: EXEC and OUTPATH. First, it runs and prints
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe`EXEC 2>&1`. If it returns successfully, it writes the output to OUTPATH.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard LoweThis script will return successfully unless writing the output fails.
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe puts "Writing output of #{EXECPATH} to #{OUTPATH}"
c10c16dec587a0662068f6e2991c29ed3a9db943Richard Lowe puts "#{EXECPATH} failed to run trial. Ignoring."