There are quite a few names to avoid in your scripts. Even if there are not reserved-words, keep away !
I’ll start with test
cd $HOME/bin
vi test
echo hello world
chmod +x test
./test
hello world
The problem is that it may break your other scripts
$ ssh localhost test 1 = 2 && echo WHAT???
hello world
WHAT???
And it may break sooner or later, depending on your OS / version / default shell / default path / others.
There are quite a few filenames you should not use, like test
, date
, time
, hostname
, mail
, view
, touch
, sort
and make
. The command type
lists some of those as reserved word, shell builtin, tracked alias, shell keyword. But again it is not consistent over Unix flavors.
$ uname -sr; type date
SunOS 5.10
date is /usr/bin/date
$ uname -sr; type date
Linux 2.6
date is a tracked alias for /bin/date
Your sysadmin may also alias things for colors and safety in the common profile: for instance vi
, ls
, rm
. But if it annoys you, then use \vi
instead of vi
.