What is your favorite shell.

Not sure if this is a tcsh thing or a find thing but the behavior was unexpected ( for me anyway ).

Code:
> cd /usr/ports
> find . -type d -name fish*
find: No match.
> find . -type d -name *fish*
find: No match.

You should put quotes around these regular expressions:

Code:
/usr/ports % find . -type d -name "*fish"
./news/newsfish
./misc/cuttlefish
./biology/jellyfish
./devel/py-babelfish
./devel/py-jellyfish
./devel/rubygem-cheffish
./sysutils/thefish
./sysutils/catfish
./irc/p5-POE-Component-IRC-Plugin-Blowfish
./irc/hexchat-fish
./irc/irssi-fish
./security/p5-Crypt-Twofish
./security/pear-Crypt_Blowfish
./security/p5-Crypt-Eksblowfish
./security/pear-Horde_Crypt_Blowfish
./security/p5-Crypt-Blowfish
./net/gofish
./shells/fish
./games/stockfish
./graphics/cuttlefish
./textproc/amberfish
./www/bluefish
./www/p5-WWW-Babelfish
./www/glassfish
./x11-wm/sawfish
 
You should put quotes around these regular expressions:
Not just for the reason that it makes the fish comment actually work.

Imagine what would happen if your current directory /usr/ports contained two files, one called tunafish and another called elephantfish. Now if you type your command "find . -type d -name *fish", what a shell will do to it is this: It will expand *fish, and issue the command "find . -type d -name tunafish elephantfish", and that is completely not going to work. Matter-of-fact, I think it will make find tell you about a syntax error in your command.

Lesson: If you use globs (* and ? and such) in your command line, in any place OTHER than commands that expect one or more file names, you have to escape or quote the glob characters. The find command is the most common place where this leads to errors.
 
Not sure if this is a tcsh thing or a find thing but the behavior was unexpected ( for me anyway ).

Code:
> cd /usr/ports
> find . -type d -name fish*
find: No match.
> find . -type d -name *fish*
find: No match.
> cd shells
> ls
../                                heirloom-sh/                       rc/
./                                 ibsh/                              rubygem-shellwords/
44bsd-csh/                         ion/                               rush/
Makefile                           jailkit/                           sash/
anongitssh/                        klish/                             scponly/
antibody/                          ksh-devel/                         starship/
ast-ksh/                           ksh/                               switchBashZsh/
bash-completion/                   ksh2020/                           tcsh_nls/
bash-static/                       ksh93/                             tcshrc/
bash/                              mksh/                              v7sh/
bashc/                             modernish/                         viewglob/
bicon/                             nologinmsg/                        vshnu/
bosh/                              nsh/                               wcd/
ch/                                ohmyzsh/                           xonsh/
dash/                              oksh/                              yash/
elvish/                            p5-Bash-Completion/                zsh-antigen/
envy/                              p5-Shell-Perl/                     zsh-autosuggestions/
es/                                p5-Term-Bash-Completion-Generator/ zsh-completions/
etsh/                              p5-Term-ShellUI/                   zsh-navigation-tools/
fd/                                pdksh/                             zsh-syntax-highlighting/
fish/                              pear-PHP_Shell/                    zsh/
git-prompt.zsh/                    psh/
find -type d | grep fish
 
Back
Top