Regex and Functions

Go to Problems

Functions

Functions are a small chunk of code which you may call multiple times within your script. They are particularly useful if you have certain tasks which need to be performed several times.

Bash function:
greet() {
echo Hello $1
}
Invoking the function:
greet A
greet B
Output:
Hello A
Hello B

Serious about Learning Scripting ?

Learn this and a lot more with Scaler Academy's industry vetted curriculum.
Shell scripting
Problem Score Companies Time Status
Swap Forward And Backward Slash 200
13:38
Sort by Frequency 250
30:24
Valid Email Address 350
29:08
Convert Integer To Roman Number 400
29:48