On Thu, 21 Nov 2013, David Adam wrote:
> On Wed, 20 Nov 2013, Marcin Zajączkowski wrote:
> > How can I determine that my function has something to on read stdin (to 
> > not call "read" then which would open an interactive prompt)?
> 
> This is a different question; the tty function does not check for the 
> presence or absence of data on stdin. I don't actually know of a clever 
> way of doing this from a shell script; in C I guess you'd do a select() 
> with a zero timeout or something.

I've just been informed that (at least in bash) you can use `read -n 0 -t 
0`, but this is not implemented in fish at this stage.

David Adam
zanc...@ucc.gu.uwa.edu.au
------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to