$0 scope in function and calling script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting $0 scope in function and calling script
# 8  
Old 01-05-2004
I have tried this on both Solaris 5.8 and Solaris 5.9 but I can't reproduce your failure. Post the output of:
/usr/ccs/bin/what /bin/ksh
# 9  
Old 01-05-2004
the following is output:

/bin/ksh:

version M-11/16/88i
SunOS 5.8 Generic 110662-02 January 2001
# 10  
Old 01-05-2004
Quote:
Originally posted by beckett

e.g. even though the IFS variable is defined as a comma (,) when i use the $* argument it still separates parameters with a space.
Using $* will separate the tokens with a space when it outputs them. "$*" will retain the IFS that you set.

$ IFS="," set a b c; echo $*; echo "$*"
$ a b c
$ a,b,c
# 11  
Old 01-05-2004
That's what I get too. How about:
/usr/proc/bin/pmap $$
# 12  
Old 01-05-2004
thanks Damian, that was a stupid mistake!!
# 13  
Old 01-05-2004
Quote:
thanks Damian, that was a stupid mistake!!
Welcome to the club ;-)
# 14  
Old 01-05-2004
The pmap $$ gives the following:

9310: /bin/ksh
00010000 192K read/exec /usr/bin/ksh
00040000 8K read/write/exec /usr/bin/ksh
00042000 40K read/write/exec [ heap ]
FF180000 672K read/exec /usr/lib/libc.so.1
FF238000 32K read/write/exec /usr/lib/libc.so.1
FF280000 552K read/exec /usr/lib/libnsl.so.1
FF31A000 32K read/write/exec /usr/lib/libnsl.so.1
FF322000 32K read/write/exec /usr/lib/libnsl.so.1
FF340000 16K read/exec /usr/platform/sun4u/lib/libc_psr.so.1
FF350000 16K read/exec /usr/lib/libmp.so.2
FF364000 8K read/write/exec /usr/lib/libmp.so.2
FF380000 8K read/write/exec [ anon ]
FF390000 40K read/exec /usr/lib/libsocket.so.1
FF3AA000 8K read/write/exec /usr/lib/libsocket.so.1
FF3B0000 8K read/exec /usr/lib/libdl.so.1
FF3C0000 128K read/exec /usr/lib/ld.so.1
FF3E0000 8K read/write/exec /usr/lib/ld.so.1
FFBEC000 16K read/write/exec [ stack ]
total 1816K
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling Oracle function from script

Hi I need to call a function in database and update the return value of that function with a value in csv file. test.csv 1,2,3,,5,,,8,9,10 1,2,3,4,5,,,8,9,10 1,2,3,,,,,8,9,10In the above file I want to replace column 2 with a value extracted from database like (select student_id from... (3 Replies)
Discussion started by: kev94
3 Replies

2. Shell Programming and Scripting

Calling function from another bash script

I would like to call functions from another bash script. How can I do it? Some code More code (11 Replies)
Discussion started by: kristinu
11 Replies

3. Shell Programming and Scripting

Calling a function which uses expect from a shells script

Hi all, This is the first time i am using expect. I am trying to call a function with in the shell script. The function will shh to a new server and will pass the password using expect and send. I need help in calling the fuction i am getting follaowing errors... here the script ... (8 Replies)
Discussion started by: firestar
8 Replies

4. Shell Programming and Scripting

SHELL SCRIPT Function Calling Another Function Please Help...

This is my function which is creating three variables based on counter & writing these variable to database by calling another function writeRecord but only one record is getting wrote in DB.... Please advise ASAP...:confused: function InsertFtg { FTGSTR="" echo "Saurabh is GREAT $#" let... (2 Replies)
Discussion started by: omkar.sonawane
2 Replies

5. Shell Programming and Scripting

c function calling from a pearl script

Hi, Is it possible to call a c function defined in a .c file from a pearl script? How is this possible? Thannks in advance, JS (2 Replies)
Discussion started by: jisha
2 Replies

6. Shell Programming and Scripting

Calling a C-function froma shell script

Hi, I have searched the forum for the query, But i didnt find an exact answer. I have a script(1.sh) and a c program(sample.c) sample.c contains many function definitions.( run(), find(), add() etc). I want to call functions in sample.c from 1.sh and use the return value in 1.sh... (3 Replies)
Discussion started by: jisha
3 Replies

7. UNIX for Dummies Questions & Answers

calling one function from another shell script

i have a function defined in one ksh (ksh 1) i want to use that function in another ksh (ksh 2) i am using . $<directoryname>/<ksh name> i am calling the function defined in ksh 1 in ksh 2 i want the returnstatus from the above operation but it is not executing the function what i... (1 Reply)
Discussion started by: trichyselva
1 Replies

8. Shell Programming and Scripting

Help needed in function calling in a script

:confused:Hi , I have a script as shown below: rpttxt() { name="$*" awk '/'"${name}"'/ {print $2 $3"=" $4}' file.txt } xx = rpttxt "COL_HEAD_1" awk 'BEGIN {printf("%36s \n ","'"$xx"'")}' rpttxt() is a function..I want to store the final result of this function in... (3 Replies)
Discussion started by: jisha
3 Replies

9. Shell Programming and Scripting

urgent calling function from a script

Hi, Can we define a function say func1 in a script 1.sh and call this function from another script say 2.sh by passing an argument :confused: (2 Replies)
Discussion started by: jisha
2 Replies

10. Programming

calling c++ function from script

hi, I just started to work on unix, I was wondering if it is possible to call a c++ function from a script. now, i don't mean starting a program, i mean dynamicaly calling a funtion (like working with a dll) thanks (3 Replies)
Discussion started by: Lebamb
3 Replies
Login or Register to Ask a Question