I am creating a script where I am redirecting the output of an awk command into a loop, but it's giving me this error:
sh: -c: line 3: syntax error near unexpected token `<'
sh: -c: line 3: `done < <(awk "{print}" inputfile.txt)'
I was able to run it against a different remote host, but this host is giving me an error. Does anyone know if some versions of sh/bash don't support that syntax, or know any alternatives to that syntax, or maybe spot a bug that I haven't been able to see? (I'm new to bash scripting, so even a point in the right direction would be helpful!)
Here is a pared-down version of my script that I was able to reproduce the issue on:
#!/usr/bin/env bash
host=$1
ssh $host 'while read line
do
echo "hi";
done < <(awk "{print}" inputfile.txt)'