[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: /bin/sh different than bash in fedora 11

On 19Jun2009 10:42, Herbert Gasiorowski <gasi3 web de> wrote:
| The following to commands act different - though sh is just a link to bash:
| > bash -c ". config"
| >   sh -c ". config"
| sh: line 0: .: config: file not found
| this happens after switching from Fedora 10 to 11
| Is this a bug or my fault?

It's a feature. When bash is invoked as sh it behaves in a more POSIX
compliant manner. You can expect gratuitous bash behaviours to not
always work.

In this case I suspect (untested) that "config" is not an executable file.

I strongly recommend that you try to always work with "sh" unless
there's some amazing reason to rely on bash; that way your code will be
portable to other UNIX systems. They all have "sh" but not all have
Cameron Simpson <cs zip com au> DoD#743

Sometimes you just need to look reality in the eye, and deny it.
        - Garrison Keillor

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]