diff options
author | Einhard Leichtfuß <alguien@respiranto.de> | 2018-12-23 07:06:00 +0100 |
---|---|---|
committer | Einhard Leichtfuß <alguien@respiranto.de> | 2018-12-23 07:06:00 +0100 |
commit | a22ff75e023034068d07adae2ebc427607b24b5d (patch) | |
tree | 146c797ae2cee3bbe302f3a74467e04014f8c9ae /basic.sh | |
parent | cbbef9daa26418fd13aaa23cbb97ec0e536ae4e1 (diff) |
Simplify and abstract from "$tmp"
- Add input and write to basic.sh to no longer need to know "$tmp" in
the calling scripts.
Also,
- make runnable from outside the directory containing the scripts,
- simplify chained grep and sed commands.
Diffstat (limited to 'basic.sh')
-rw-r--r-- | basic.sh | 14 |
1 files changed, 14 insertions, 0 deletions
@@ -47,6 +47,20 @@ function init tmp_="$tmp_d/b" } +# $1: file to treat as input: filename +# requires: init to be run +function input +{ + cp "$1" "$tmp" +} + +# $1: file to write to: filename +# requires: init and input to be run +function write +{ + cp "$tmp" "$1" +} + function cleanup { rm -rf "$tmp_d" |