17 Feb
2002
17 Feb
'02
13:53
At the basic level, it sets file descriptor 4 to the file named in the
expression. I know that 0 thru 2 have standard meanings. I'm not
clear what file descriptor 4 is. The expression is value of
$XAUTHORITY if it exists, $HOME/.Xauthority if it doesn't. "exec 4<"
sets file descriptor 4 of the current script to its argument. You
will have to look else where in the script for what this file
descriptor is used for.
This is left as an exercise for the reader.
Jeffrey
Quoting Avi Schwartz
Hi,
I am trying to figure out how does 'sux' work and I am stuck on the following line:
exec 4< ${XAUTHORITY:-$HOME/.Xauthority}
Can someone please explain to me what does it do?
Thanks, Avi