Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Expect script causing Invalid Switch message

Avatar of Dan Kaib
Dan KaibFlag for United States of America asked on
SSH / Telnet SoftwareScripting LanguagesShell Scripting
11 Comments1 Solution2717 ViewsLast Modified:
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.

TIA,
Dan

ASKER CERTIFIED SOLUTION
Avatar of gelonida
gelonidaFlag of France image

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 11 Comments.
See Answers