typeset in Korn Shell scripts

From: Sal Serafino (serafino@cshl.edu)
Date: Fri Feb 24 2006 - 10:38:52 EST


WOW! I got about 25 replies. Too many people to thank individually, so thanks
to all of you for taking the time to point out that I can't see the forest for
the trees. I should have looked at the source to see how this is called!

Except for two people who suggested calling 'typeset' by its full path (can't be
done because 'typeset' is a Korn built-in!) EVERYONE ELSE figured out that the
binary MUST be calling "sh /usr/local/bin/cdfilesxfer2". Because the Bourne
shell doesn't recognize the shebang, it failed to call ksh. Instead, it ran the
script by itself. Explains why typeset is not found.

Thanks again folks,
-Sal

------------- Begin Forwarded Message -------------

Date: Thu, 23 Feb 2006 18:10:58 -0500 (EST)
From: Sal Serafino <serafino@cshl.edu>
Subject: typeset in Korn Shell scripts
To: sunmanagers@sunmanagers.org
Mime-Version: 1.0
Content-MD5: lCgMvhzDuCeM6VhE17gwMw==

OK - I've beaten myself on this one to no end. I have a Korn script that uses
the 'typeset -l' command to translate a value into lower case. The script works
fine from the command line, from crontab entries, and also with at/batch
submission.

We have a system call from a compiled binary that calls this script and we get:

                 typeset: not found

Here are the important parts of the script,which receives nine parameters:

#!/bin/ksh
# Received parameters debug
echo "PL part 3 = " $3
X2=$3
typeset -l X2
cp /$1/$2/print/$4/$5/1/$X1 /$1/$2/$X2/work/cdfiles/current/$7"."$8"."$9".wri"

I don't understand why it's not working, and I can't find anything in the ksh or
the typeset man pages about what turns it on/off. For now, I've replaced the
assignment of X2 and the typeset command with:

        X2=`echo $3 | tr '[:upper:]' '[:lower:]'`

This works, but it's not what I wanted to do.

TIA,
-Sal

------------- End Forwarded Message -------------
_______________________________________________
sunmanagers mailing list
sunmanagers@sunmanagers.org
http://www.sunmanagers.org/mailman/listinfo/sunmanagers



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 23:39:06 EDT