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
How will you find the 99th line of a file using only tail and head command?
In my bash shell I want my prompt to be of format '$"present working directory":"hostname"> and load a file containing a list of user-defined functions as soon as I log in, how will you automate this?
How do you know which shell I am using?
Where are cowrie shells found?
What is the equivalent of a file shortcut that we have a window on a linux system?
Explain how you Automate your application using Shell scripting.
What is the syntax of "nested if statement" in shell scripting?
How to debug the problems encountered in the shell script/program?
Is shell scripting a programming language?
What is shell scripting?
Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.
Determine the output of the following command: [ -z “” ] && echo 0 || echo 1
What is scripting used for?
What exactly is a shell?
Is scripting and coding the same thing?