diff options
author | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-18 17:22:46 +1300 |
---|---|---|
committer | Tom Ryder <tom@sanctum.geek.nz> | 2015-12-18 17:22:46 +1300 |
commit | 435e83853bf4ebec58dff41b328e832cb23ded3c (patch) | |
tree | d5177d54f2a87e1eef9d1517069fa6c6b4f6b10c | |
parent | Flatten _path completion spec a bit (diff) | |
download | dotfiles-435e83853bf4ebec58dff41b328e832cb23ded3c.tar.gz dotfiles-435e83853bf4ebec58dff41b328e832cb23ded3c.zip |
Avoid calling cat(1) by using builtins
-rw-r--r-- | bash/bashrc.d/keep.bash | 4 | ||||
-rw-r--r-- | bash/bashrc.d/path.bash | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/bash/bashrc.d/keep.bash b/bash/bashrc.d/keep.bash index 8480fd53..dd130b36 100644 --- a/bash/bashrc.d/keep.bash +++ b/bash/bashrc.d/keep.bash @@ -45,7 +45,9 @@ keep() { # -h given; means show help h) - cat <<EOF + while IFS= read -r line ; do + printf '%s\n' "$line" + done <<EOF $FUNCNAME: Keep variables and functions in shell permanently by writing them to named scripts iterated on shell start, in \$BASHKEEP (defaults to ~/.bashkeep.d). diff --git a/bash/bashrc.d/path.bash b/bash/bashrc.d/path.bash index d2bf6d37..39d9e453 100644 --- a/bash/bashrc.d/path.bash +++ b/bash/bashrc.d/path.bash @@ -15,7 +15,9 @@ path() { # Print help output (also done if command not found) help|h|-h|--help|-\?) - cat <<EOF + while IFS= read -r line ; do + printf '%s\n' "$line" + done <<EOF $FUNCNAME: Manage contents of PATH variable USAGE: |