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 meant by dos operating system?
Is powershell a language?
Set up a Sev 2 alert when the Primary WA service fails. A windows batch script needs to be created that will monitor the WA service on the Primary and when the service stops/fails a Sev 2 TT is generated for a particular team ?
How do you find out What is your shell?
Where is bash history?
How can you find out how long the system has been running?
What is the equivalent of a file shortcut that we have a window on a linux system?
What is the significance of $#?
Write a command sequence to find the count of each word?
What is shell terminal?
Explain about login shell?
What are the various stages of a linux process it passes through?
How does path variable work?
Suppose you execute a command using exec, what will be the status of your current process in the shell?
What is option in shell script?