aboutsummaryrefslogtreecommitdiff
path: root/vpeval
diff options
context:
space:
mode:
authorJohn Ankarström <john@ankarstrom.se>2021-06-06 21:41:54 +0200
committerJohn Ankarström <john@ankarstrom.se>2021-06-06 21:41:54 +0200
commit8b50c699652e39812024af2c34973c6359302c46 (patch)
treed56fbf1e0999617ad6c64fd5192ffe4225fd9ea6 /vpeval
parent5dd1844b66908cb16f7b7e1a792a11b9780de183 (diff)
downloadvp-8b50c699652e39812024af2c34973c6359302c46.tar.gz
Read stdin if not a tty
Diffstat (limited to 'vpeval')
-rwxr-xr-xvpeval7
1 files changed, 6 insertions, 1 deletions
diff --git a/vpeval b/vpeval
index 4c5b785..3031cff 100755
--- a/vpeval
+++ b/vpeval
@@ -1,2 +1,7 @@
#!/bin/sh
-echo "$(eval "$(sed '/^#/d')" 2>&1)" | sed 's/^/# /'
+{
+ if [ -z "$VPIN" ]
+ then eval "$(sed '/^#/d')" 2>&1
+ else eval "$(sed '/^#/d')" 2>&1 <"$VPIN"
+ fi
+} | sed 's/^/# /'