1830900 Members
3194 Online
110017 Solutions
New Discussion

Simple ksh question

 
SOLVED
Go to solution
Jason Berendsen
Regular Advisor

Simple ksh question

I am opening a file and reading it in with the following two lines:
exec 3< ${DIR}/extract.tmp
while read -u3 LINE

Unfortunately, I can't remember how to close this file descriptor. Does anyone know how?

Thanks,

Jason
3 REPLIES 3
Rodney Hills
Honored Contributor
Solution

Re: Simple ksh question

The man page for ksh states-

exec 3<&-

should work.

HTH

-- Rod Hills
There be dragons...
Jean-Louis Phelix
Honored Contributor

Re: Simple ksh question

hi,

Perhaps "exec 3<&-"

Regards.
It works for me (© Bill McNAMARA ...)
Bill Thorsteinson
Honored Contributor

Re: Simple ksh question

It should closed when the process closed. You can also close it by redirecting &- to it.

Try executing someting in the current shell like:
. /dev/null 3<&-