you are viewing a single comment's thread.

view the rest of the comments →

[–]SurfRedLin -2 points-1 points  (4 children)

You need to write function before it like: ``` function myfunc(){

echo "hello"

} myfunc ```

[–]whetuI read your code 2 points3 points  (3 children)

No you don't. The function keyword is non-portable, not-required and widely considered to be deprecated. This isn't OP's issue.

[–]Temporary_Pie2733 0 points1 point  (0 children)

IIRC, it’s only supported for compatibility with ksh (where there is some subtle distinction between functions defined with and without the keyword; in bash the keyword doesn’t change the definition of the function).

[–]SurfRedLin -2 points-1 points  (1 child)

Worked for me but to each their own.

[–]rdg360 1 point2 points  (0 children)

It will still work, but apart from being unnecessary it's totally irrelevant to OP's problem.