I have the following command:
ssh $USER@$HOST "ls /ops/pkg/ec/`grep "PKRTS" /ops/pkg/ec | awk '{print $1}'`* > /tmp/tmp_file"
What the above SHOULD do..is, ssh to the host then execute the command. The command should first execute the grep and awk between the back ticks, and generate a file name, then ls using that filename* and write that data to a temp file.
However, it executes the grep and awk before even SSH'ing and the command that goes to the server is simply an "ls /ops/pkg/ec/* > /tmp/tmp_file" since the grep and awk return nothing on the local machine.
Any ideas how to get around this?
