aboutsummaryrefslogtreecommitdiff
path: root/open-stdin
diff options
context:
space:
mode:
Diffstat (limited to '')
-rwxr-xr-xopen-stdin8
1 files changed, 4 insertions, 4 deletions
diff --git a/open-stdin b/open-stdin
index 5c0ee1e..a1e10b5 100755
--- a/open-stdin
+++ b/open-stdin
@@ -1,12 +1,12 @@
1#!/bin/sh 1#!/bin/sh
2 2
3# Saves standard input in a download folder and opens it (spawn) 3# Saves standard input in a temporary file and opens it (spawn)
4# Usage: open-stdin 4# Usage: open-stdin
5# Requires: open-file 5# Requires: open-file (or set $OPENER to e.g. xdg-open)
6 6
7#folder=$HOME/Downloads/open-stdin
8folder=${TMPDIR:-/tmp} 7folder=${TMPDIR:-/tmp}
8open=${OPENER:-open-file}
9 9
10tempfile=$(mktemp -p "$folder") 10tempfile=$(mktemp -p "$folder")
11 11
12cat > "$tempfile" && open-file $@ "$tempfile" 12cat > "$tempfile" && $open $@ "$tempfile"

Generated with cgit - Back to sebastiano.tronto.net