Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

2
  • why are you hard-coding the path? On my system, ~user is /home2/user; It could also be something else, not including user in any way or form. That also prevents the user from overriding it via HOME=/some/path /path/to/script. Commented Nov 12, 2021 at 0:36
  • It's not that they "don't work in variables", it's rather that they're not expanded within quotes, so the expanded value isn't even stored in the variable. chmod 400 "~/.ssh/xxx.pem" would have the same problem. Commented Nov 12, 2021 at 10:10