LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 03-15-2011, 06:58 AM   #1
joost1
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Rep: Reputation: 0
CGI shell scripting: is it possible to call function from other script?


Hello,

I got two cgi shell scripting files. Is it possible when i am in file 1, to call a function from file 2?

Thanks in advance
 
Old 03-15-2011, 10:04 AM   #2
Vlinux6
LQ Newbie
 
Registered: Nov 2010
Distribution: VectorLinux
Posts: 23

Rep: Reputation: 1
Yes, to be able to use functions from a second file, you have to source it like this:

. /path/to/file.sh

(note the period and space at the beginning)
I'm pretty sure this is correct. You should then be able to simply call the functions from file 2 as if they were in file 1.
HTH
 
Old 03-16-2011, 02:09 AM   #3
joost1
LQ Newbie
 
Registered: Mar 2011
Posts: 5

Original Poster
Rep: Reputation: 0
It works. Thank you very much.
 
  


Reply



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
[SOLVED] QNX checksum call in cgi shell scripting not working joost1 Programming 4 03-14-2011 06:39 AM
Call CGI w/POST variables from shell matthewo256 Red Hat 1 06-16-2009 10:53 AM
How to Call a C program from Perl CGI Script anoop_cn Programming 1 05-11-2004 04:37 PM
cgi and shell scripting, setting it up? GridX Programming 7 04-12-2004 11:01 PM
another cgi and shell scripting problem + webserver prinski Programming 6 04-08-2004 04:25 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:45 AM.

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