Answer Posted / pitambar mishra
### Note : Function always returns a value.
### This script is for adding two numbers.
### Script name : add.ksh
#!/bin/ksh
sum() ### Defining sum function
{
echo enter 2 no :
read num1 num2
echo sum=$(( num1 + num2 ))
}
sum ### Invoking sum function
To execute it :
ksh add.ksh
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What will happen to my current process when I execute a command using exec?
What is bash command used for?
What is eval in shell script?
one folder contains lot of students name but I want to fetch hello with every student name individually using shell script
Where are cowrie shells found?
Calculate a real number calculation directly from the terminal and not any shell script.
What is meant by $1 in shell script?
How do I run a shell script on a mac?
Write a shell script to get current date, time, user name and current working directory.
Is shell a part of kernel?
What lives in a shell?
What is bash coding?
what is info area how many types?
How will you pass and access arguments to a script in linux?
how to get part of string variable with echo command only?