cp003421_home > cat /etc/SuSE-release
SUSE Linux Enterprise Desktop 11 (x86_64)
VERSION = 11
PATCHLEVEL = 2
cp003421_home > Version AJM 93u+ 2012-08-01

1. type sources the function definition file if it is executable, I wonder 
whether this is intended

cp003421_home> unset FPATH
cp003421_home> type testfunc
ksh: whence: testfunc: not found
cp003421_home> type testfuncx
ksh: whence: testfuncx: not found
cp003421_home> typeset -x FPATH=/ya/yae55/yae5511/utils
cp003421_home> ls -la utils/testfunc utils/testfuncx
-rw-r----- 1 yae5511 yae55 205 Jun 18 15:45 utils/testfunc
-rwxr-x--- 1 yae5511 yae55 206 Jul 16 10:26 utils/testfuncx
cp003421_home> type testfunc
testfunc is an undefined function
cp003421_home> type testfuncx
testfuncx is an undefined function
cp003421_home> typeset -f testfunc
cp003421_home> typeset -f testfuncx
function testfuncx {

typeset LOCALVAR=1

#unset -f common_func
#typeset -f common_func

common_func () { echo "Local function"; }

if [[ $1 = f ]]; then
  common_func
else
  echo "Local script body"
fi

}


2. a function is not found in FPATH if PATH ends in ":" and PWD=FPATH

cp003421_utils> cat typesettest.sh
#!/bin/ksh
FPATH=~/utils
typeset -p FPATH

cd $FPATH
echo "Current dir: " $(pwd)

type testfunc
type testfuncx
type testfuncx

cd $HOME
echo "Current dir: " $(pwd)

type testfunc
type testfuncx
type testfuncx

cp003421_utils> ./typesettest.sh
typeset -x FPATH=/ya/yae55/yae5511/utils
Current dir:  /ya/yae55/yae5511/utils
./typesettest.sh[9]: whence: testfunc: not found
testfuncx is a tracked alias for /ya/yae55/yae5511/utils/testfuncx
testfuncx is a tracked alias for /ya/yae55/yae5511/utils/testfuncx
Current dir:  /ya/yae55/yae5511
testfunc is an undefined function
testfuncx is a tracked alias for /ya/yae55/yae5511/testfuncx
testfuncx is a function

cp003421_utils> PATH=${PATH%:}

cp003421_utils> ./typesettest.sh
typeset -x FPATH=/ya/yae55/yae5511/utils
Current dir:  /ya/yae55/yae5511/utils
testfunc is an undefined function
testfuncx is an undefined function
testfuncx is a function
Current dir:  /ya/yae55/yae5511
testfunc is an undefined function
testfuncx is a function
testfuncx is a function

This is a problem in scripts only, it is not reproducible on the command line

Mit freundlichen Gruessen / Best Regards
Axel PHILIPP
Dr. rer. nat., Dipl. Phys.
MTU Aero Engines AG
Information Management/Engineering Systems (FIE)

--
MTU Aero Engines AG
Geschaeftsfuehrung/Board of Management: Egon W. Behle, Vorsitzender/CEO; Dr. 
Rainer Martens, Michael Schreyögg, Dr. Stefan Weingartner, Reiner Winkler
Vorsitzender des Aufsichtsrats/Chairman of the Supervisory Board: Klaus 
Eberhardt
Sitz der Gesellschaft/Registered Office: Muenchen
Handelsregister/Commercial Register: Muenchen HRB 157206

Diese E-Mail sowie ihre Anhaenge enthalten MTU-eigene vertrauliche oder 
rechtlich geschuetzte Informationen.
Wenn Sie nicht der beabsichtigte Empfaenger sind, informieren Sie bitte den 
Absender und loeschen Sie diese
E-Mail sowie die Anhaenge. Das unbefugte Speichern, Kopieren oder Weiterleiten 
ist nicht gestattet.

This e-mail and any attached documents are proprietary to MTU, confidential or 
protected by law.
If you are not the intended recipient, please advise the sender and delete this 
message and its attachments.
Any unauthorised storing, copying or distribution is prohibited.
_______________________________________________
ast-users mailing list
[email protected]
http://lists.research.att.com/mailman/listinfo/ast-users

Reply via email to