[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-bash] Weird error of bash "/bin/sh: line 1: `BASH_FUNC_f%%': n
From: |
Peng Yu |
Subject: |
Re: [Help-bash] Weird error of bash "/bin/sh: line 1: `BASH_FUNC_f%%': not a valid identifier" |
Date: |
Sat, 4 Oct 2014 11:44:49 -0500 |
>> A script like main.sh used to work on my Mac OS X. But somehow it
>> stops working. Can anybody see what is wrong? Where is "BASH_FUNC_f%%"
>> defined?
>
>> /tmp$ export -f f
>
> This line injects BASH_FUNC_f%% into the environment.
How to refer to BASH_FUNC_f%% if I want to?
/tmp$ function f {
> :
> }
/tmp$ BASH_FUNC_f%%
bash: BASH_FUNC_f%%: command not found
>> /tmp$ ./main.sh
>
> You didn't show us the contents of main.sh.
Here are the contents.
/tmp$ cat /tmp/main.sh
#!/bin/sh
>> /bin/sh: line 1: `BASH_FUNC_f%%': not a valid identifier
>
> Your /bin/sh is buggy. POSIX says that implementations should tolerate
> (that is, silently ignore or erase) invalid environment variable names
> that they do not understand, rather than loudly complain. Since Mac OS
> is proprietary, I cannot help you fix your /bin/sh; but please raise a
> bug report to Apple to fix their /bin/sh.
But /bin/sh is essentially an earlier version of bash. Is there a
problem with this version of bash?
/tmp$ /bin/sh --version
GNU bash, version 3.2.51(1)-release (x86_64-apple-darwin13)
Copyright (C) 2007 Free Software Foundation, Inc.
--
Regards,
Peng