Yoo
Yoo

Reputation: 18346

home directory expansion (~) within an argument

When I enter the following (BASH):

rdesktop -r disk:bacon=~/bacon host

It does not expand to

rdesktop -r disk:bacon=/home/me/bacon host

It seems the "disk:" part is the problem as can be seen in:

$ echo bacon=~/bacon disk:bacon=~/bacon

bacon=/home/me/bacon disk:bacon=~/bacon

How can I make tilde expand?

Upvotes: 15

Views: 14658

Answers (2)

P Shved
P Shved

Reputation: 99304

While ~ does not expand (it's used as specially routed of the path), $HOME does.

rdesktop -r disk:bacon=$HOME/bacon host

But be careful with environment-changing su!

Upvotes: 17

pilcrow
pilcrow

Reputation: 58589

rdesktop -r disk:bacon=$(echo ~/bacon) host

will do it. It won't please the eye, but it will work.

Upvotes: 6

Related Questions