The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

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 and shell scripting languages 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 12:26 PM
How to call the c library created by shc alfredo Shell Programming and Scripting 0 03-31-2008 12:20 PM
how to call awk in a csh Program bikas_jena Shell Programming and Scripting 5 11-25-2007 05:24 AM
how to differentiate system call from library call muru UNIX for Advanced & Expert Users 2 07-19-2007 11:20 PM
how to call a perl script from tcsh? megastar Shell Programming and Scripting 1 10-22-2005 05:48 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 04-04-2006
nir_s nir_s is offline
Registered User
  
 

Join Date: Jun 2004
Posts: 148
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
  #2 (permalink)  
Old 04-04-2006
nir_s nir_s is offline
Registered User
  
 

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

Nir
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 09:53 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0