2 ms·
Note that the reason bash works here is actually a bit ugly. Like fish, it'll interpret an unquoted asterisk (sorry HN formatting) as the glob character. So it
by faho 9y ago
Note that the reason bash works here is actually a bit ugly.
Like fish, it'll interpret an unquoted asterisk (sorry HN formatting) as the glob character. So it tries to match pathnames to `host:directory/`.
Only the default bash behavior (if "nullglob" and "failglob" aren't set) is to pass the literal glob expression if no match could be found.
So once you `mkdir host:directory; touch host:directory/file` (which you can do - this is unix, so almost all pathnames are allowed), this will be broken.
This means you _should quote the token_ in bash, which is exactly what you should do in fish.
Note: This is also why you might see code like the following in bash:
for file in *; do
if test -e "$file"
See http://mywiki.wooledge.org/BashFAQ/004 http://mywiki.wooledge.org/BashFAQ/004 and http://mywiki.wooledge.org/glob#nullglob http://mywiki.wooledge.org/glob#nullglob for more info.