Artificial intelligent assistant

How to reset the file descriptor I was trying to use file descriptor for printing the lines in the file #!/usr/bin/ksh exec 3<&0 exec 0< file.txt while read LINE do echo “$LINE” done and I am done with my code ,it prints the output as like my wish I forgot to reset the file descriptor of 0 exec 0<&3 what will happen ? 1. The descriptor scope will last only inside the program or entire unix shell? 2. How we come to know which value is holding which file descriptor (printing the values of file descriptor using shell) 3. It will automatically reset the system (AIX) is restarted ?

File descriptors belong to a process: the current process, that is. Immediately when you exit a process, the assignments have no effect. Even a subshell (or any child process) that inherit the file descriptors, have from the fork() call their own copies of the file descriptors (a file descriptor is just a number pointing to an IO resource in linux kernel). It's just like open files - opening a file in one process doesn't make it open for everyone and if you don't close it yourself, linux closes it and cleans up when the process terminates.

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy a9ac6a602846ef4c1110947310e72605