Syntax error near unexpected token `='()

bobblebub

I'm running some legacy code on bash shell and I'm having trouble understanding/passing through this line:

BASH_FUNC_module()='() {  eval `/usr/bin/modulecmd bash $*`
}'; export BASH_FUNC_module()

The error I get is:

line 364: syntax error near unexpected token `='() {  eval `/usr/bin/modulecmd bash $*`
}''
line 364: `}'; export BASH_FUNC_module()'

Any pointers would be appreciated, I'm new to shell :) Thanks!

Mike Frysinger

it looks like you're trying to convert some trace/dump output of bash. most likely you want:

module() { eval `/usr/bin/modulecmd bash $*`; }
export -f module

that should work on old/new versions of bash.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related