sddsxref functions differently in one specific script

Moderators: cyao, michael_borland

Post Reply
foshea
Posts: 34
Joined: 23 Jun 2009, 21:00

sddsxref functions differently in one specific script

Post by foshea » 23 Jun 2021, 17:22

This is a bit of a long shot, but I don't have any better ideas on where to ask for help on this problem. I'm trying to get the length of the beamline into the track.lost file from track.twi. To do this, I use two commands:

Code: Select all

sddsprocess track.twi -noWarnings -process=s,last,length
sddsxref track.lost track.twi -leave=* -transfer=param,length
When I run these two commands sequentially at the command line, it works as I expect and adds the length parameter to track.lost. But, when I put these two lines into a bash script, the sddsxref throws a bunch of warnings that look like the following

Code: Select all

warning: no row in file 2 for row 2353 in file 1
and then, when I run "sddsquery track.lost" I see that sddsxref has tried to populate track.lost with the column data from track.twi, but that shouldn't be happening (according to the help file on sddsxref) because I used "-leave=*", and it certainly doesn't happen when I run the commands at the command prompt. [Edit: The two commands run as expected if I copy them into another script and run that.] Because of all this, I think I'm tripping on some keyword in some other piece of my script that is causing sddsxref to act differently.

I have attached the trackError script here, in the hopes that one of the sdds-wizards here can identify the mistake I'm making. Failing that, I can work around this problem if I knew a way to take that length parameter and put it into another sdds file that is otherwise empty. Does anyone have a trick for that?

soliday
Posts: 368
Joined: 28 May 2008, 09:15

Re: sddsxref functions differently in one specific script

Post by soliday » 23 Jun 2021, 18:12

Most likely you will have to put the -leave=* inside quotes "-leave=*"
It sounds like bash is expanding the * value before passing it to sddsxref. So it is actually passing a list of files in the directory instead of *

foshea
Posts: 34
Joined: 23 Jun 2009, 21:00

Re: sddsxref functions differently in one specific script

Post by foshea » 25 Jun 2021, 14:40

A work-around I found is that I can put the offending commands in a different script and call that script from trackErrors, and it works without any other changes. I'm not sure if that is of general interest, but maybe that fact will help a future reader.

Post Reply