Closing the stdin in Bash script

For one of my requirement my script is behaving oddly and the reason come out was its stdin was open ( will right in detail later)

 

to fix the issue I need to close the stdin

reference - http://superuser.com/a/364519/439394

 

Closing File Descriptors

n<&-

Close input file descriptor n.

0<&-, <&-

Close stdin.

n>&-

Close output file descriptor n.

1>&-, >&-

Close stdout.

Bas

comments powered by Disqus