summaryrefslogtreecommitdiff
path: root/chromium/testing/iossim/redirect-stdout.sh
blob: feff2c9694a40dff463d8ec5ce11af1ded8963f6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/sh
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# This script executes the command given as the first argument and redirects
# the command's stdout to the file given as the second argument.
#
# Example: Write the text 'foo' to a file called out.txt:
#   RedirectStdout.sh "echo foo" out.txt
#
# This script is invoked from iossim.gyp in order to redirect the output of
# class-dump to a file (because gyp actions don't support redirecting output).

if [ ${#} -ne 2 ] ; then
  echo "usage: ${0} <command> <output file>"
  exit 2
fi

exec $1 > $2