head 1.1; branch 1.1.1; access; symbols libdrm-1_0_4:1.1.1.1 snapshots-20031203-import:1.1.1.1 snapshots:1.1.1; locks; strict; comment @# @; 1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches 1.1.1.1; next ; 1.1.1.1 date 2003.12.03.15.37.55; author fxkuehl; state Exp; branches; next ; desc @@ 1.1 log @Initial revision @ text @#!/bin/sh # GNU sed doesn't support in-place editing (option -i). This script wraps # sed to do exactly that. # It assumes that the last command line argument specifies the file to edit. # If that file doesn't exists exit with exit code 1. set -e file="" for param; do file=$param done if [ -z "$file" ]; then echo "Missing command line arguments." 1>&2 exit 1 fi if [ ! -f "$file" ]; then echo "File $file does not exist." 1>&2 exit 1 fi if [ -f "$file.~sednew~" ]; then echo "An existing temporary file $file.~sednew~ is in the way." 1>&2 exit 1 fi if ! sed "$@@" > "$file.~sednew~"; then exit $? fi mv "$file.~sednew~" "$file" @ 1.1.1.1 log @Imported snapshot build scripts. @ text @@