2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
6 # This script executes the command given as the first argument and redirects
7 # the command's stdout to the file given as the second argument.
9 # Example: Write the text 'foo' to a file called out.txt:
10 # RedirectStdout.sh "echo foo" out.txt
12 # This script is invoked from iossim.gyp in order to redirect the output of
13 # class-dump to a file (because gyp actions don't support redirecting output).
15 if [ ${#} -ne 2 ] ; then
16 echo "usage: ${0} <command> <output file>"