In the long run, special cases like that often turn out to be more trouble than they are worth. If an ordinary file happened to start with '~' it would not be handled correctly. So you either accept or ignore that potential problem, or you have to write extra code to work around it. It's safer to not have such special cases at all.
Just recently I used '~' in the remote target path in the scp command, and, somewhat unexpectedly, it created the directory with that name and put the files there.
In 99% of cases, yes - this is a pain in the backside. Long ago I adopted something from the plan9 way of doing things (when I was heavily using acme).
Just symlink /h to /home. So ~user becomes /h/user, in places where ~ is not expanded for you.
bch|1 year ago
[0] https://core.tcl-lang.org/tips/doc/trunk/tip/602.md
throw0101b|1 year ago
> Consider the naive attempt to clean out the /tmp directory.
> cd /tmp
> foreach f [glob *] {file delete -force $f}
> A file ~ or ~user maliciously placed in /tmp will have rather unfortunate consequences.
cmacleod4|1 year ago
mirekrusin|1 year ago
Koshkin|1 year ago
isr|1 year ago
Just symlink /h to /home. So ~user becomes /h/user, in places where ~ is not expanded for you.