scripts

Various scripts for UNIX-like systems
git clone https://git.tronto.net/scripts
Download | Log | Files | Refs | README

open-stdin (258B)


      1 #!/bin/sh
      2 
      3 # Saves standard input in a download folder and opens it (spawn)
      4 # Usage: open-stdin 
      5 # Requires: open-file
      6 
      7 #folder=$HOME/Downloads/open-stdin
      8 folder=${TMPDIR:-/tmp}
      9 
     10 tempfile=$(mktemp -p "$folder")
     11 
     12 cat > "$tempfile" && open-file $@ "$tempfile"