OLD | NEW |
(Empty) | |
| 1 #!/bin/bash |
| 2 |
| 3 # Copyright 2015 The Crashpad Authors. All rights reserved. |
| 4 # |
| 5 # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 # you may not use this file except in compliance with the License. |
| 7 # You may obtain a copy of the License at |
| 8 # |
| 9 # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 # |
| 11 # Unless required by applicable law or agreed to in writing, software |
| 12 # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 # See the License for the specific language governing permissions and |
| 15 # limitations under the License. |
| 16 |
| 17 if [[ "${BASH_SOURCE[0]}" = "${0}" ]]; then |
| 18 echo "${0}: this file must be sourced, not run directly" >& 2 |
| 19 exit 1 |
| 20 fi |
| 21 |
| 22 # Some extensions of command-line tools behave differently on different systems. |
| 23 # $sed_ext should be a sed invocation that enables extended regular expressions. |
| 24 # $date_time_t should be a date invocation that causes it to print the date and |
| 25 # time corresponding to a time_t string that immediately follows it. |
| 26 case "$(uname -s)" in |
| 27 Darwin) |
| 28 sed_ext="sed -E" |
| 29 date_time_t="date -r" |
| 30 ;; |
| 31 Linux) |
| 32 sed_ext="sed -r" |
| 33 date_time_t="date -d@" |
| 34 ;; |
| 35 *) |
| 36 echo "${0}: unknown operating system" >& 2 |
| 37 exit 1 |
| 38 ;; |
| 39 esac |
OLD | NEW |