tcsh user failed to call library in ksh program


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting tcsh user failed to call library in ksh program
# 1  
Old 04-04-2006
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  
Old 04-04-2006
OK folks,I found a solution:
chmod -R 666 ${cdromPath}/lib solve my problem.

Nir
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

Call failed: RPC: Can't decode result

Hello I am trying to run rpc program to query an entry from a file at the server side that is in the form of <mm> <dd> <event>. I get the proper result at the server. I have verified it by printf statements just before return statement of the result at server side. But somehow I am unable to... (0 Replies)
Discussion started by: mvikramreddy92
0 Replies

2. AIX

Backup: The lseek call failed

Hi, We are facing issues while backing up our 1205 GB filesystem on LTO5 Tape. During backup the "backup: The lseek call failed." messages were generated, I want to know why these messages were generating AIX version is: 6100-08-00-0000 backup: The date of this level 0 backup is Mon Mar 11... (4 Replies)
Discussion started by: m_raheelahmed
4 Replies

3. Shell Programming and Scripting

TCSH user input checks

I would like to check user input for arguments 1 and 2 for my Solaris TCSH script for the following: 1. That both user input arguments are numbers. 2. That they are both at least 5 digits. Thanks for the help. (1 Reply)
Discussion started by: thibodc
1 Replies

4. UNIX for Advanced & Expert Users

System call failed with 127 .. after 500 times when called in loop

Hi Experts, I have a code like this. ===== #include.... int main() { int count = 0; while(1){ printf("\n Interation number is: %d \n ",count); rv = system(" test.sh > log.txt " ); if (-1 == rv) { printf("Could not generate static log: error... (12 Replies)
Discussion started by: binnyjeshan
12 Replies

5. UNIX for Advanced & Expert Users

Remote commands fail for tcsh user

I'm more familiar with bash/ksh that csh/tcsh. With that said, I recently ran across a problem with tcsh. Our system admin recently installed purify on our solaris 8 system. In order to use purify you have to execute a Rational script in order to setup the paths and some environment variables... (3 Replies)
Discussion started by: sszd
3 Replies

6. Shell Programming and Scripting

tcsh and user input

Here is my script: echo "var 1:" read varone echo "$varone" When I run in via ksh the script runs successfully. However when I run it via tcsh I get "varone: Undefine variable" Does the name command not work with tcsh or do I need some additional modification? Is there a way to get... (1 Reply)
Discussion started by: bonesy
1 Replies

7. Programming

How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg. > square 4 16 There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively. If I would like to... (1 Reply)
Discussion started by: alfredo
1 Replies

8. Shell Programming and Scripting

How to call the c library created by shc

I have written a shell script called square, which prints the square of the input number, eg. > square 4 16 There is a program called shc which compiles the shell scirpt and create a executable file and a c library file, namely square.x and square.x.c repectively. If I would like to... (0 Replies)
Discussion started by: alfredo
0 Replies

9. UNIX for Advanced & Expert Users

how to differentiate system call from library call

Hi, Ho do I differentiate system call from library call? for example if I am using chmod , how do I find out if it is a system call or library call? Thanks Muru (2 Replies)
Discussion started by: muru
2 Replies

10. Shell Programming and Scripting

how to call a perl script from tcsh?

Hi I am not sure how to call a perl script from a tcsh shell. do i need to set any environment variables? your help is appreciated Thanks (1 Reply)
Discussion started by: megastar
1 Replies
Login or Register to Ask a Question

Featured Tech Videos