Skip to content

Instantly share code, notes, and snippets.

@oliwer
Created December 10, 2015 10:45
Show Gist options
  • Save oliwer/33ca2387f488879aa27c to your computer and use it in GitHub Desktop.
Save oliwer/33ca2387f488879aa27c to your computer and use it in GitHub Desktop.
mksh IPC
<lynx> btw, in *ksh you do this: find "$@" -print0 |& while read -pd ''; do …
<igli> ah does that keep the while in fg?
<lynx> yes
<igli> sweet
<lynx> it's actually two lines
<lynx> you newline after find "$@" -print0 |&
<lynx> it's conceptually like &
<lynx> except stdio of find is connected to fd 'p'
<lynx> you can even do things like exec 3>&p
<igli> ah ok
<lynx> then echo >&3 to communicate to the subprocess
<lynx> later exec 3>&- to close its stdin
<igli> heh
<lynx> stderr is shared
<lynx> well if you need that. this is how I remote-controlled SQL*plus from ksh
<lynx> just started the sqlplus at begin of script, then read and wrote to when needed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment