Stephen Odewahn |
02/10/2014 11:04PM (Read 3339 times)
|
|
|
Status: offline
Registered: 07/11/2007
Posts: 3
|
Running what looks like a normal login.cl froma normal xgterm I get:
% cl
curdir:
ERROR: Cannot change directory to `'
called as: `chdir ()'
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
In some iraf.net articles, I see the chdir problem
can have something to do with having pwd aliased in
some mode where a response is given. This appears to
not be the case for me:
% source .cshrc
% alias pwd
I have grepped around for "curdir" but have found nothing.
Thanks,
Steve
|
|
|
|
fitz |
02/10/2014 11:14PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
I think the problem is coming from the use of 'pwd' in the hlib$extpkg.cl script, i.e. the line
PHP Formatted Code printf ("!pwd\n") | cl () | scan (curdir )
Try editing this file to explicitly make it "/bin/pwd" to avoid any possible alias/shell problems.
|
|
|
|
Stephen Odewahn |
02/11/2014 12:15AM
|
|
|
Status: offline
Registered: 07/11/2007
Posts: 3
|
% vi /home/sco/Iraf_Things/iraf_sco/unix/hlib/extpkg.cl
I did three versions:
-------------------------------------------------------------------
Version1:
#printf ("!pwd\n") | cl () | scan (curdir) #---- suggested by MF Feb2014
printf ("/bin/pwd\n") | cl () | scan (curdir)
Result:
% cl
**: /bin/pwd
^
ERROR: syntax error
called as: `cl ()'
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
-------------------------------------------------------------------
-------------------------------------------------------------------
Version2:
printf ("!/bin/pwd\n") | cl () | scan (curdir)
% cl
curdir:
ERROR: Cannot change directory to `'
called as: `chdir ()'
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
-------------------------------------------------------------------
-------------------------------------------------------------------
Version3:
#printf ("!pwd\n") | cl () | scan (curdir) #---- suggested by MF Feb2014
printf ("/bin/pwd") | cl () | scan (curdir)
% cl
INTERNAL ERROR: parser gagged
called as: `cl ()'
called as: `cl ()'
called as: `cl ()'
Error while reading login.cl file - may need to rebuild with mkiraf
Fatal startup error. CL dies.
-------------------------------------------------------------------
In the first version, it appears I'm having trouble with space at
the end, but I'm not sure how to prevent that.
-Steve
|
|
|
|
fitz |
02/11/2014 12:18AM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
The correct version is
printf ("!/bin/pwd\n") | cl() | scan (curdir)
where the '!' is an escape to the shell and the '\n' is required to complete the read.
Any chance you have a pathname with a space in it (e.g. "/home/Steve O/.....")?? Otherwise, what does /bin/pwd print from the normal unix prompt?
|
|
|
|
Stephen Odewahn |
02/11/2014 12:50AM
|
|
|
Status: offline
Registered: 07/11/2007
Posts: 3
|
Again:
I try:
printf ("!/bin/pwd\n") | cl () | scan (curdir)
**** With same failure.
From my command line:
% echo $SHELL
csh
% /bin/pwd
/home/sco/Iraf_Things/test1
Thinking maybe there were problems with "_" I tried:
% /bin/pwd
/home/sco/t
This is the dir where I did mkiraf and have my login.cl
|
|
|
|
fitz |
02/11/2014 05:37PM
|
|
|
Status: offline
Registered: 09/30/2005
Posts: 4040
|
I still can't find a way to reproduce this using a variety of machines or login shells. As a test you could workaround the problem by temporarily renaming your hlib$extpkg.cl to skip this step of the login. Then, presuming you login successfully try issuing the commands manually, i.e.
cl\$this->_split2($m[0]) string curdir # to define the variable
cl\$this->_split2($m[0]) printf ("!/bin/pwd\n") | cl()
cl\$this->_split2($m[0]) printf ("!/bin/pwd\n") | cl() | scan (curdir)
cl\$this->_split2($m[0]) show curdir
Note that the 'cl' command itself is a shell script so I would check your .cshrc/.login or your .bashrc/.profile files to see whether they change directories automatically for some reason. Also, do a "which cl" to see whether you're using an aliased command or the symlink that was created when you ran the install script.
|
|
|
|
jhunk |
06/30/2016 03:24PM
|
|
|
Status: offline
Registered: 12/15/2015
Posts: 1
|
Sorry to necro your thread here, but it is the top hit on Google and the workarounds described here did not work for me.
Before:
PHP Formatted Code
# Go to the dynamic package directory, but save the current directory so
# we can return when we're done. At this stage of the login we need to
# use host commands since the system package isn't available.
printf ("!pwd\n") | cl () | scan (curdir )
chdir (extdir )
Output:
PHP Formatted Code
# NOTE: Current directory contains a valid login.cl file
$ cl
curdir : [waiting for input here ]
Instead of relying on the string returned from /bin/pwd, I simply referenced the current directory from the shell environment:
After:
PHP Formatted Code
# Go to the dynamic package directory, but save the current directory so
# we can return when we're done. At this stage of the login we need to
# use host commands since the system package isn't available.
curdir = osfn ("PWD")
chdir (extdir )
Output:
PHP Formatted Code
$ cl
setting terminal type to xterm ...
NOAO /IRAF PC -IRAF Revision 2.16 EXPORT Thu May 24 15:41:17 MST 2012
This is the EXPORT version of IRAF V2 .16 supporting PC systems .
# etc, etc...
ecl >
I can't speak for every shell on the planet but the major players, BASH, ZSH, *CSH all set $PWD automatically if you change your current working directory.
|
|
|
|