First to admit that i'm a scripting noob but basically i'm having trouble spawning an expect session when the command i'm trying to run has double dashes. Ie as follows:

```
#!/usr/bin/expect -f
set command "mysqlimport -h mysql.someserver.amazonaws.com -P 3306 -u root --fields-enclosed-by=\"|\" -p myDBHere --local /var/www/csvuploads/tablename "
spawn {*}$command
expect "password:"
send -- "mypassword\r"

```

I get an error saying:

```
mysqlimport: Error: 1083, Field separator argument is not what is expected; check the manual, when using table: INT_BRN_BRAND

```

Now i think I know what is happening. I think the double dash is getting picked up by the spawn and then the mysqlimport doesn't get it's field separator set.. It's the same reason you'd put a "--" after send. I believe this tells TCL or Expect that there are no more options for the given command.

**The real question**

So how does one spawn a process that has -- flags?

**Things I HAVE tried**

Adding a double dash after the spawn.
Escaping the dashes in the command text with \u002d
Use autoexpect to generate a script to do what i want.
Instead of spawning mysqlimport i tried spawning a new bash shell and "send --" the command to that. I got close but ran into a whole different set of issues.