aspose file tools*
The moose likes Linux / UNIX and the fly likes how can i call a shell script method in other program Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "how can i call a shell script method in other program" Watch "how can i call a shell script method in other program" New topic
Author

how can i call a shell script method in other program

saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Here is a problem in calling the methods being inside in another shell script program

can any one please tell me how to call a method which is there in another shell script is there any command to import that shell script file in my current program?

The reason why i am doing this thing is i am writing more frequenty used methods in one palce (utility.sh) file

so here i want to call the methods when ever i require to use it in other program


A = HARDWORK B = LUCK/FATE If C=(A+B) then C=SUCCESSFUL IN LIFE else C=FAILURE IN LIFE
SCJP 1.4
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923


or shorter


http://home.arcor.de/hirnstrom/bewerbung
saikrishna cinux
Ranch Hand

Joined: Apr 16, 2005
Posts: 689
Originally posted by Stefan Wagner:

or shorter


No Mr Stefan..
I have not intended to callt the script file instead my question was like this
There is utility file in which there are multiple methods which take parameters when passed

so now in my program i want to call one particular method in utility script file by passing some parameters

So how cna i call a particular methods of other scipt file ?
any command ?

thanks for helping me
Stefan Wagner
Ranch Hand

Joined: Jun 02, 2003
Posts: 1923

Originally posted by saikrishna cinux:


No Mr Stefan..
I have not intended to callt the script file instead my question was like this
There is utility file in which there are multiple methods which take parameters when passed

so now in my program i want to call one particular method in utility script file by passing some parameters

So how cna i call a particular methods of other scipt file ?
any command ?

thanks for helping me

Stefan is my first name, just call me Stefan.

When you source a file which contains just functions, not code calling these functions, they are available for execution by your script.

utils.sh:

useutils.sh sources utils.sh and calls the functions:

output:
2008-14-01/23/08
3 2 1
2008-14-01/23/08
1 2 3
2008-14-01/23/08
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how can i call a shell script method in other program