In the expression
r=`vx $* < \`tty\` > \`tty\``
vx as an executable filename to which you pass all (
$*) of the arguments passed to the current script after shell expansion. For example, if the arguments to the script were
* `ls /dev` then the argument list passed to vx will be the names of all of the files in the current directory plus the names of all of the files in
/dev. The number of arguments will be the same as the number for file names.
vx is assumed to accept input on its standard input.
tty is an executable that returns a string that Bash interprets as a filename.
Note that the first invocation of
tty could return a different filename than the second invocation' for example, if
tty produces the filename based on some external condition such as the content of the file with the name produced by the previous invocation, or based on a timestamp or other external condition that could change.
r=`...` assigns the standard output of the backticked command to
r. The return value of the backticked expression is in
Since the standard output of
vx is redirected to the filename produced by the second invocation of
tty, the value of
r will always be empty (
r=) which is the same as
r=0 in the expression
[[ r -ne 0 ]]. The result is that there is no situation where the loop can run more than once.