LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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: 29,415
Blog Entries: 55

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


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
.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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:19 PM.

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