0

This question already has an answer here:

I have this:

docker.r2g(){
  echo "foo";
}


export -f docker.r2g

my editor complains, I try these instead

export -f 'docker.r2g'
export -f "docker.r2g"

I get this message:

'docker.r2g' is not a valid identifier.

Is there a way to include a dot in a bash function name or should I not do this?

marked as duplicate by muru, Jesse_b, Community Jun 1 '18 at 2:53

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

  • What editor are you using? I almost always use . in my bash function names without any issue. – Jesse_b Jun 1 '18 at 1:41
  • I am using the bash plugin for Webstorm – Alexander Mills Jun 1 '18 at 1:50
  • Without testing, the bash reference manual says that a name is used for functions, and that does not include a dot/period. – Jeff Schaller Jun 1 '18 at 1:52
  • so official bash says dots aren't really that kosher right – Alexander Mills Jun 1 '18 at 1:53
  • I don't understand how bash and your editor have anything to do with one another? What editor? – Andy Dalton Jun 1 '18 at 2:16