summaryrefslogtreecommitdiffstats
path: root/noise
diff options
context:
space:
mode:
authortv <tv@xso>2011-09-09 18:22:01 +0200
committertv <tv@xso>2011-09-09 18:22:01 +0200
commit150ce5757d2982da740bd9ce2b44b57b6d2831c6 (patch)
tree455015096a7c41bdc9f105d7d7aea3f0d70841a8 /noise
parentd5ab191b88cfd211ce39e4226df10616b25af179 (diff)
//noise: kill another instance of sed -i
Diffstat (limited to 'noise')
-rwxr-xr-xnoise/noise8
1 files changed, 5 insertions, 3 deletions
diff --git a/noise/noise b/noise/noise
index 99a08023..615277a6 100755
--- a/noise/noise
+++ b/noise/noise
@@ -31,8 +31,8 @@ noise_set() { # set a variable
fi
## write variable to $env
if grep -q "^$1=" "$env" ; then
- env_cache="`cat $env`"
- echo "$env_cache" |
+ cache="`cat $env`"
+ echo "$cache" |
sed "s'^\($1\)=\(.*\)\$'\1=\'$2\''" > $env
else
echo "$1='$2'" >>$env
@@ -49,7 +49,9 @@ noise_unset() { # unset a variable
case $# in
(1) ##
unset "noise_$1"
- sed -ni "/^$1=/!p" $env
+ cache="`cat $env`"
+ echo "$cache" |
+ sed -n "/^$1=/!p" > $env
;;
(*)
fail "broken commandline: $@"