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 is mac default shell?
What is an inode block?
How to redirect both standard output and standard error to the same location?
How will you find the 99th line of a file using only tail and head command?
How to print all the arguments provided to the script?
What is a shell script in windows?
What are script files?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
What does chmod do?
What is eval in shell script?
What is the crontab?
What is shell scripting used for?
How to pass an argument to a script?
What is the meaning of $1 in shell script?
Please give me example of " at command , contrab command " how to use