Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 #!/bin/sh | |
| 2 | |
| 3 # Copyright (c) 2014 The Chromium Authors. All rights reserved. | |
| 4 # Use of this source code is governed by a BSD-style license that can be | |
| 5 # found in the LICENSE file. | |
| 6 | |
| 7 # This script generates a C source declaring a string with the contents of a | |
| 8 # given file. | |
| 9 # Usage: | |
| 10 # ./suppression_string_gen.sh <variable_name> <input> <output> | |
| 11 | |
|
Nico
2014/05/27 15:42:30
set -eu?
Alexander Potapenko
2014/05/28 10:34:38
Done.
| |
| 12 varname=$1 | |
| 13 infile=$2 | |
| 14 outfile=$3 | |
| 15 | |
| 16 echo "char ${varname}[] =" > ${outfile} | |
| 17 cat ${infile} | awk '{printf("\"%s\\n\"\n", $0)}' >> ${outfile} | |
| 18 echo ";" >> ${outfile} | |
| OLD | NEW |