New xfreerdp syntax in Bash script i.e. colons (:) and forward slashes (/)

1.2k Views Asked by At

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(?).

1

There are 1 best solutions below

0
On

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.