Download your favorite Linux distribution at LQ ISO.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


Search this Thread
Old 03-10-2009, 04:32 PM   #1
LQ Newbie
Registered: Mar 2009
Posts: 1

Rep: Reputation: 0
Question bash function calling problem

hi guys
I'm new in linux and bash

I have 2 file &
    echo "input is ${1}"
echo "say something"
read x
I want call myFun function from file
I know how to invoke a function, the following code will work good

    echo "input is ${1}"
myFun ${1}
but I want call myFun() directly from
i mean this
    echo "input is ${1}"
#myFun ${1} // invoke it from, something like (myObject.myFun() in java )
how can i do this?
it drives me crazy
Old 03-10-2009, 04:42 PM   #2
TBC Cosmo
Registered: Feb 2004
Location: NY
Distribution: Fedora 10, CentOS 5.4, Debian 5 Sparc64
Posts: 355

Rep: Reputation: 43
Originally Posted by arashdx View Post
hi guys

I want call myFun function from file

how can i do this?
in, put this in the beginning.


then call the function as you would if directly from


bash, file, function

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Calling a function in javascript mohtasham1983 Programming 4 03-04-2008 05:13 PM
calling a function from within another function in php jayakrishnan Programming 2 06-19-2007 09:36 AM
calling a function within a task manas_sem Programming 1 02-23-2007 04:51 PM
calling a function from a pointer spx2 Programming 3 05-25-2006 05:52 PM
Calling another function from a function using GTK geminigal Programming 4 07-11-2005 04:15 PM

All times are GMT -5. The time now is 04:33 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration