- 
                Notifications
    
You must be signed in to change notification settings  - Fork 1.9k
 
SC1065
        Joachim Ansorg edited this page Jul 5, 2024 
        ·
        4 revisions
      
    foo(input) {
  echo "$input"
}
foo("hello world");foo() {
  echo "$1"
}
foo "hello world"Shell script functions behave just like scripts and other commands:
- They always take a 0 to N parameters, referred to with 
$1,$2etc. They can not declare parameters by name. - They are executed using 
name arg1 arg2, and not with parentheses as C-like languages. 
None.