Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Literal `~` directory created?



On 2023-05-18 at 13:59 +0000, thomas.david.vaughan@xxxxxxxxx wrote:
> I ran `brew bundle install` in a newly created directory which contained only
> a Brewfile, and noticed that afterwards a directory named `~` had been
> created:

> I have noticed this before perhaps as far back as three months ago, but I
> never could narrow it down enough to understand what might be causing this. I
> would see this after I ran some homemade scripts I wrote to maintain the
> software installed on my laptop. These scripts always ran brew so maybe it's
> the culprit?

The expansion of `~` is something which the shell does when invoking a
command, but if the command is getting a value from a configuration file
then it needs to be supported on a per-app basis, because then the shell
isn't involved doing some of the work for it.

Similarly, if you have something which wants to use `~` as the default
value for a flag, then that's going to be ... "iffy".

So grep for '~' in your config files and try replacing it with $HOME
instead, see if the command does env-var expansion or if you end up with
a directory named '$HOME' in your home-dir.  :^)

There's nothing zsh-specific or zsh-involved here: the problem is
arising _because the shell is not being involved_.

-Phil




Messages sorted by: Reverse Date, Date, Thread, Author