I'm trying to query the contents of a log file on a remote server, however, I can't seem to get it to work.
#!/bin/bash
while read line; do
echo "Do stuff to the file, line by line"
done < ( ssh -n user@server "cat /path/to/file" )
I get a syntax error at the first parenthesis. If I remove the parenthesis, I get a syntax error at the "-n" flag.
Everything works properly from the shell, so I'm assuming there is some behavior here that I'm not understanding correctly.
Thanks!