On Sat, 25 Jul 2009, Ken Irving wrote: > On Fri, Jul 24, 2009 at 07:36:31PM -0700, michael rice wrote: > > Is there a problem with naming a bash script file "script"? I'm using > > Fedora 11. > > > > ... > > [mich...@localhost ~]$ cat ./bin/script > > #!/bin/bash > > # Sample shell script > > echo "The date today is `date`" > > echo Your shell is $SHELL > > echo Your home directory is $HOME > > echo The processes running on your system are shown below: > > ps > > > > [mich...@localhost ~]$ script > > Script started, file is typescript > > The "which" command is useful to see how a command will be resolved. If > you type: > > which script > > you'll likely see something other than what you're expecting.
The "which" command is not a good way to see how a command will be resolved. It is an external command (and at least one version will not work with bash), and it doesn't know about shell functions or aliases. The command to use is 'type'. With the -a option, it will tell you all of the possible commands that use the name. If you have a command, a function and an alias with the same name, it will list all three. -- Chris F.A. Johnson, webmaster <http://woodbine-gerrard.com> =================================================================== Author: Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)