3 ms·
I've used fish as my shell for over five years. Thanks to the developers! One issue is the behavior of globs. I often want to do "scp host:directory/* ." but y
by canjobear 9y ago
I've used fish as my shell for over five years. Thanks to the developers!
One issue is the behavior of globs. I often want to do "scp host:directory/* ." but you can't do that in fish, so I drop to bash. That's pretty much all I drop to bash for.
- rufugee 9y agoscp host:directory/\* .
- jhasse 9y agoAlso possible: scp 'host:directory/*' .
- deleted 9y ago[deleted]
- faho 9y agoNote 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.