linux - bash - two ways to write function syntax -


in bash can write function , have 2 ways ( 2 syntax ) ,

please advice

what differences between example1 example2

or maybe there no differences?

 function i_love_function   {    .   .   } 

i_love_function ()  {    .   . } 

how call function i_love_function

from: http://www.gnu.org/software/bash/manual/bashref.html#shell-functions

functions declared using syntax:

name () compound-command [ redirections ]  or  function name [()] compound-command [ redirections ] 

this defines shell function named name. the reserved word function optional. if function reserved word supplied, parentheses optional.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -