> -----Original Message-----
> From: Tim Jenness [mailto:[log in to unmask]]
> Sent: 06 December 2003 00:30
> To: [log in to unmask]
> Subject: Re: Parameter system question
>
>
> On Fri, 5 Dec 2003, Malcolm J. Currie wrote:
>
> > > As for Alan's comment concerning why the "+" is the obvious
> > > candidate. This repeatedly failed for all the blazars I
> was reducing
> > > that had pluses in but '-' was fine and all the other
> sources with
> > > underscores were okay.
> >
> > Also "+" is a metacharacter in grep and awk. "-" is too
> but only if
> > it appears within brackets. Can the metacharacter be escaped?
>
> If I put an \ in front of the plus sign things get worse:
>
> !! Error reading file names from stream attached to shell process -
> ! Interrupted system call
> !! No files found matching the file specification
> !
> '/export/data/timj/scuba/scd/blazars/x2107\+52/out/adam_4061/k
> appa_mon'.
> !
> !
> !
> !
> !
> !
> !
>
> and the ! lines go on forever. The command never returns!
>
I can't see a mechanism for this.
> >
> > Just a quick thought on a different tack. Is it anything
> to do with
> > "+<number>" being treated as a number rather than a string? Does
> > inserting an "@" before the path help?
> >
>
> It does seem to be "+<number>" that causes the problem.
> Putting an @ in front is the same as trying to escape the +.
An @ is of significance to the parameter system and would have been dropped
by the time it gets to HDS_OPEN. If calling HDS directly, it would be
assumed to be part of the filename.
>
>
> Further investigations don't seem to help me. I know wihhc
> hds_open is causing the problem:
>
> hds_open($filename, 'READ', $ploc, $$status);
>
> in NDF.pm (where I'm getting the parameter) but if I run that
> code outside of the pipeline it works fine. Running
> hds_tune() prior to this call fixes the problem in the
> pipeline. Does anyone know whether the ADAM system configures
> something in HDS that triggers this filename expansion which
> does not happen when I write a 5 line program that just opens
> the file?
ADAM (in DTASK_MAIN) calls HDS_TUNE to set HDS_SHELL to 1 if the HDS_SHELL
environment variable is not set.
>
> Where do I find the code that does this (possibly to track
> down why the error message is infinitely long). Expanding
> $HOME and ~ is one thing, expanding +<number> is not so clear to me.
>
I think the code in HDS is rec1_get_path.c and rec1_find_file.c.
It appears that the presence of + in an otherwise fully resolved file name
will cause the shell expansion unless HDS_SHELL is -1. I had thought the
only thing involved in the expansion was globbing (hence my query about +)
but I now see that awk may be
involved. This needs more study - I've set Brian on it.
|