The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to call the c library created by shc alfredo High Level Programming 1 03-31-2008 09:26 AM
How to call the c library created by shc alfredo Shell Programming and Scripting 0 03-31-2008 09:20 AM
how to call awk in a csh Program bikas_jena Shell Programming and Scripting 5 11-25-2007 02:24 AM
how to differentiate system call from library call muru UNIX for Advanced & Expert Users 2 07-19-2007 08:20 PM
how to call a perl script from tcsh? megastar Shell Programming and Scripting 1 10-22-2005 02:48 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 04-04-2006
Registered User
 

Join Date: Jun 2004
Posts: 146
tcsh user failed to call library in ksh program

Hi folks,

I'm trying to organize functions in my ksh program into libraries.
If I run my program as any ksh user it will succeed.
Only when I run my program as tcsh user (i.e oracle) I failed.

Example
=======
The ksh code:
Code:
tornado:/tmp # cat nir.ksh 
#! /bin/ksh

cdromPath=`pwd`
FPATH=${cdromPath}/lib
infra_lib > /dev/null
slogen
The library code:
Code:
tornado:/tmp> cd lib/
tornado:/tmp/lib> cat infra_lib 
############################################################################################


#------------------------------------------------------------------
slogen()
{
flow
flow ; echo "Installation version 5.0"; flow
echo "\n\n"
sleep 2
}
#--------------------------------------------------------------------
#------------------------------------------------------------------
flow()
{
   i=0
   until [ i -eq 55 ] ; do
     echo "$symbol\c" ; i=`expr $i + 1`
   done
   echo "\n"
   symbol="-"
}
#------------------------------------------------------------------

Code:
tornado:/tmp # su - nsternfe
No mail for nsternfe
tornado:/home/nsternfe> echo $SHELL
/bin/ksh
tornado:/home/nsternfe> cd /tmp
tornado:/tmp> ./nir.ksh 
./nir.ksh[5]: infra_lib: function not defined by /tmp/lib/infra_lib


-------------------------------------------------------

Installation version 5.0
-------------------------------------------------------
Now I'm trying to run the ksh as user oracle:
Code:
tornado:/tmp # su - oracle
tornado:/home/oracle > 
tornado:/home/oracle > cd /tmp
tornado:/tmp > echo $SHELL
/bin/tcsh
tornado:/tmp > ./nir.ksh 
./nir.ksh[6]: slogen: not found
As you can see,the function slogen in the library can not be found.

How should I configure tcsh users to identify libraries?

Thanks in advance,
Nir
Reply With Quote
Forum Sponsor
  #2  
Old 04-04-2006
Registered User
 

Join Date: Jun 2004
Posts: 146
OK folks,I found a solution:
chmod -R 666 ${cdromPath}/lib solve my problem.

Nir
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 10:43 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0