[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference vmszoo::vms_posix

Title:POSIX for OpenVMS - Public forum
Notice:Internal users of V2.0 please register in note 909
Moderator:STAR::PARKE
Created:Fri Jan 04 1991
Last Modified:Mon Jun 02 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:1370
Total number of notes:5127

1361.0. ""test.;" is executed when entering POSIX" by EWBV05::KUNIYOSHI () Wed Jan 29 1997 03:15

	If the file named as "test.;" is in the default direcry,it is executed 
	as the shell script when entering into posix from DCL.  (Why???)

	Unfortunatelly, the customer has a file which contains character of
	"test".
	It causes the following error. it seems that it is looping infinitly 
	and many shell processes are created until error happens.

	$ type test.;
	test
	$ posix
	test 1: test: cannot fork: Resource temporarily unavailable
	test 1: test: Internal error: j_close: no processes
	psx>	

	This occurs on V2.0 and V3.0.
	The question is,

	Is this the problem or not ?
	Why is "test.;" executed ? 

	Thanks,
	Makito Kuniyoshi/CSC Tokyo
T.RTitleUserPersonal
Name
DateLines
1361.1SPECXN::DERAMODan D'EramoWed Jan 29 1997 11:439
        Do they also have a file named
        
        	.profile
        
        (a shell script which POSIX will run on startup).  Perhaps
        their .profile is running the test command, and it just picks
        up the file named test. in the home directory.
        
        Dan
1361.2EWBV05::KUNIYOSHIWed Jan 29 1997 21:2612
	I understood the story.

	The customer does not have .profile in home directory.
	But,/etc/profile is executed when entering POSIX and /etc/profile
	contains "if" statement. It seems that "if" statement is actually 
	executes as "test" command.
	So "test.;" is executed when entering to posix.

	Thanks,
	Makito  

1361.3 [ ] MUCTEC::BECKERHartmut B., VMS & Languages, MunichThu Jan 30 1997 04:2126
>       contains "if" statement. It seems that "if" statement is actually
>       executes as "test" command.

It's not the if, it's the ' [ ... ] '. Man pages for test explain that the
brackets are an alternate form for test, which normally lives in /bin.

Probably you know how to work around this problem:

From /etc/profile:
export  \
        SHELL=/bin/sh \
        PS1='psx> '
        PATH=.:/usr/bin:/bin

if [ -f /usr/dce/bin/dce_defs.sh ]
then
        . /usr/dce/bin/dce_defs.sh
fi

The current directory . is first in the search path. If you move it at the
end /bin/test should be used in the 'if'. There is a drawback. If you have
programs with the same name as programs in /usr/bin or /bin the modified
search path will find the system provided programs first and start them. To
run your version of these programs the prefix ./ is necessary.

Hartmut