diff options
author | Morgan Deters <mdeters@gmail.com> | 2012-09-27 20:11:59 +0000 |
---|---|---|
committer | Morgan Deters <mdeters@gmail.com> | 2012-09-27 20:11:59 +0000 |
commit | 51daaee8eb1ee55ee3323c5395a95fd121fe87a8 (patch) | |
tree | 7995be78d4283ea601f4e51f8acdadda2e46759a | |
parent | db67d074ee6bf4ec295763c83ccbe3ae29810eb3 (diff) |
finally, a portable solution
-rwxr-xr-x | src/options/mkoptions | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/options/mkoptions b/src/options/mkoptions index 92c8317f7..cc581e69c 100755 --- a/src/options/mkoptions +++ b/src/options/mkoptions @@ -1175,7 +1175,8 @@ function output_module { repl="$repl2" echo -n ";s,$(eval echo "\$\{$var\}"),$repl,g" >>"$output.sed" done - sed -f "$output.sed" -i "$output.working" + sed -f "$output.sed" "$output.working" >"$output.working2" + mv -f "$output.working2" "$output.working" error="$(grep '.*\${[^}]*}.*' "$output.working" | head -n 1)" if [ -n "$error" ]; then error="$(echo "$error" | sed 's,.*\${\([^}]*\)}.*,\1,')" @@ -1352,7 +1353,8 @@ for var in \ repl="$repl2" echo -n ";s,$(eval echo "\$\{$var\}"),$repl,g" >>"$output.sed" done -sed -f "$output.sed" -i "$output.working" +sed -f "$output.sed" "$output.working" >"$output.working2" +mv -f "$output.working2" "$output.working" error="$(grep '.*\${[^}]*}.*' "$output.working" | head -n 1)" if [ -n "$error" ]; then error="$(echo "$error" | sed 's,.*\${\([^}]*\)}.*,\1,')" |