Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Opening a file for READing within script? (Last question today ;) )



On 2008-12-10 at 09:34 -0800, Webb Sprague wrote:
> I want to open a file given at the command line for reading by
> associating it with a file descriptor number and then running
> 
> read -u 4 HEADERLINE

exec 4< "$filename"
# do stuff, then close with:
exec 4<&-

(This is not special to zsh)

-Phil



Messages sorted by: Reverse Date, Date, Thread, Author