0

I frequently connect to Windows VMs from Linux using xfreerdp and wanted to make a Bash function to shorten my typing but am running into issues.

The function I am trying in .bashrc:

function rdp { xfreerdp /v:"$1" /u:"$2" /p:"$3" /f /multimon /sound /clipboard; }

export -f rdp

If I then try:

rdp windowshost myusername mypassword

It just makes xfreerdp print out the help information implying broken syntax somewhere. Ideally what I want is to take in hostname / IP, user name and password as arguments and away we go. Or even better, take host, username and password as arguments or prompt for whichever are not provided.

My suspicion is the new FreeRDP syntax using colons and forward slashes doesn't play nice with Bash(?).

Lennon
  • 43
  • 4
  • That looks fine to me. If you run `set -- windowshost myusername mypassword; xfreerdp /v:"$1" /u:"$2" /p:"$3" /f /multimon /sound /clipboard` manually from a fresh shell session does it work? – Etan Reisner Dec 19 '14 at 04:31
  • 1
    Sounds like there is a bug in xfreerdp. It should not be giving you a usage statement, but instead it should provide a useful error message. You should file a bug with xfreerdp to get that cleaned up before you do anything else. – William Pursell Dec 19 '14 at 04:45

1 Answers1

0

Not entirely sure what was going on, and a little embarrassing I did not try something so simple but Etan's suggestion worked.

I closed the xterm, opened a new one, ran the command verbatim and it worked. Then source .bashrc, ran the function itself again and it worked. Go figure.

Lennon
  • 43
  • 4