Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How to declare functions in unix shell script?

Answer Posted / sujay kumar

First method:

function function_name
{
}

Second Method:

function_name()
{
}

For both methods, the invocation of function would be in
the same format only.

Invocation:

function_name

Is This Answer Correct ?    62 Yes 12 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is shell terminal?

943


What shell is bin sh?

955


Explain how you Automate your application using Shell scripting.

2306


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

4119


What are types of shells?

1021


How does ls command work?

1020


What are the different types of variables used in shell script?

1042


What is bash coding?

917


Is shell scripting difficult?

943


How can I set the default rwx permission to all users on every file which is created in the current shell?

1419


What is path variable bash?

1032


How are shells born?

957


What does $1 mean in bash?

1085


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?

1134


What is the default ubuntu terminal?

1115