LinuxSA Mailing list archives

Index: [thread] [date] [subject] [author]
  From: Alex Garner <alex@garner.cx>
  To  : Dave Lawrence <philaw@camtech.net.au>, "'linuxsa@linuxsa.org.au' <philaw@camtech.net.au>
  Date: Sun, 27 Jun 1999 16:05:18 -0700

Re: Not executable unless...

At 13:18 24/06/99 +0930, Dave Lawrence wrote:
>Also, here's a tip for beginner programmers, never name your test
>executables "test" ;)

Good point.

The reason for this is the bash built-in `test` will be executed instead
and it will look like nothing happened. You can disable the built-in with
`enable`.

The order of execution of various sources of commands in bash is:

1) Aliases
2) Keywords like `function`, `if`, and `for`.
3) Functions
4) Built-ins like `cd` and `test`
5) Scripts and executables, located in PATH environment variable.

You can change the order of precedence by using the built-ins `command`
`builtin` and `enable`.

It is also a bad idea to put `.` in your path (the current directory),
because it opens your system up to trojan scripts and executables. Get used
to typing commands with the prefix `./`

Of course all of this is in `man bash`  :o)

Anyone care to comment on differences with different shells? I use bash
exclusively and don't know much about the other flavours.

Cheers

Alex!

Index: [thread] [date] [subject] [author]
Return to the LinuxSA Mailing List Information Page