The output of the netcat command nc - dvzw1 8.8.8.8 443 does not appear to behave in the way that output from other commands have predictably worked when stored in a variable or piped through the read utility.
Storing the nc cmd output to a variable
cmd_output=$(nc -dvzw1 8.8.8.8 443)produces an empty variable. Same result without the v switch. Other cmds can be stored to variable (ls -a, pwd, date).Piping the nc output to the read utility as below writes nothing to the file. Same result without the v switch.
nc -dvzw1 8.8.8.8 443 | while read line ; do echo -e "$now $line" ; done >> ~/vpn.log
The 'while read echo' pipe has worked with another command. I can also redirect the nc command output directly to file ( ie: without piping to 'while read echo').