How to declare functions in unix shell script?

Answer Posted / nandish

we can pass the parameter also
ex: function fun_name () {

# write block here
}
invoke function as

fun_name parameter1 parameter2 ...

Is This Answer Correct ?    9 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why do we write bin bash in shell scripts?

547


Write the syntax for "if" conditionals in linux?

599


How to calculate the number of passed arguments?

558


What is the default shell of solaris?

579


What is the equivalent of a file shortcut that we have a window on a linux system?

609






how to get part of string variable with echo command only?

594


What is the best shell scripting language?

543


What is bash used for?

581


Explore about environment variables?

599


Using set -A write a script to print the output of the ls command in 5 columns with two spaces between each column. Pretend that ls does not have multicolumn output.

2035


Explain about sourcing commands?

640


How does ls command work?

589


What is bash eval?

551


Explain about login shell?

637


I have to write Shells (Linux + Unix)for publishing packages and reports. Is it possible ? What are the differents executable programs ineed to call ?

1686