top | item 41662262

(no title)

Zuider | 1 year ago

Why did they remove tilde '~' as a convenient shortcut for the Home directory?

discuss

order

bch|1 year ago

Tcl Improvement Proposal (TIP) 602[0].

[0] https://core.tcl-lang.org/tips/doc/trunk/tip/602.md

throw0101b|1 year ago

One example from the document:

> 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

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.

mirekrusin|1 year ago

Should be starts with ~/

Koshkin|1 year ago

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.

isr|1 year ago

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.