LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices

Reply
 
Search this Thread
Old 11-02-2006, 10:24 AM   #1
trek413
LQ Newbie
 
Registered: Aug 2006
Posts: 15

Rep: Reputation: 0
Check that script is being sourced


I have a script that must be sourced. Is there some way
to check that the script is being executed in this fashion
and throw an error if not?
 
Old 11-02-2006, 11:38 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 27,290
Blog Entries: 54

Rep: Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854Reputation: 2854
assimilate() { source "$1" 2>/dev/null || echo "in ${FUNCNAME}(): \"$1\" not ${FUNCNAME}d "; }
]$ assimilate microsoft
in assimilate(): "microsoft" not assimilated
 
  


Reply


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
.bash_profile and /etc/profile not sourced? FogSwimmer Ubuntu 7 10-05-2006 05:45 AM
zsh return 0 if script sourced not executed cs-cam Linux - General 2 08-12-2006 11:41 AM
LXer: More Sendmail Inc. software to be open sourced LXer Syndicated Linux News 0 06-19-2006 06:33 AM
.bashrc not being sourced shanenin Linux - Software 1 01-05-2005 10:07 PM
.bashrc not sourced koyi Slackware 4 08-02-2003 10:00 AM


All times are GMT -5. The time now is 03:42 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration