I have a script that works on a local system.
When I try to execute that script from an expect script using ssh on another system, I get an Invalid Switch message on the following statement:
sort -ru oldfile > newfile
The spawn statement from the expect script is as follows:
spawn ssh "$USER@$IP" "$CMD" "$PARAMS"
This is running from Cygwin.
Is there something in expect or ssh that is preventing the switches on remote command execution to be recognized?
Any suggestions would be greatly appreciated.