Hi!

----

The following testcase...
-- snip --
redirect {basefd}<"."
touch "x5"
cd -@ "x5"
redirect {n}<"."
cd -f ${basefd}
(cd -f "$n" ; print "hello5" >"myxattr5")
/usr/bin/runat "x5" "cat myxattr5"
(cd -@ "x5" ; cat "myxattr5" )
rm "x5"
-- snip --
... shows an issue with cd -f $fd in subshells in ast-ksh.2013-12-06
on Solaris 11/B145/64bit... it seems it doesn't restore the cwd of the
parent shell level when the non-|fork()|'ing subshell terminates:
-- snip --
$ ~/bin/ksh -x xattr_cd_fd002.sh
+ command exec
+ {basefd}< .
+ touch x5
+ cd -@ x5
+ command exec
+ {n}< .
+ cd -f 12
+ cd -f 10
+ print hello5
+ 1> myxattr5
+ /usr/bin/runat x5 'cat myxattr5'
runat: cannot open x5: No such file or directory
+ cd -@ x5
xxx.sh[8]: cd: /dev/file/xattr@x5//@//: [Not a directory]
+ cat myxattr5
hello5
+ rm x5
rm: x5: not found
-- snip --

Here is a reduced testcase which should work on all platforms:
-- snip --
$ ~/bin/ksh -c 'mkdir -p f1 ; redirect {d}<f1 ; /bin/pwd ; (cd -f $d ;
/bin/pwd) ; /bin/pwd ; true '
-- snip --

On Solaris 11/b145/AMD64/64bit and SuSE 12.3/AMD64/64bit it prints this...
-- snip --
/home/test001/x1
/home/test001/x1/f1
/home/test001/x1/f1
-- snip --

... but AFAIK it should print:
-- snip --
/home/test001/x1
/home/test001/x1/f1
/home/test001/x1
-- snip --

----

Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) roland.ma...@nrubsig.org
  \__\/\/__/  MPEG specialist, C&&JAVA&&Sun&&Unix programmer
  /O /==\ O\  TEL +49 641 3992797
 (;O/ \/ \O;)
_______________________________________________
ast-developers mailing list
ast-developers@lists.research.att.com
http://lists.research.att.com/mailman/listinfo/ast-developers

Reply via email to