0

I am trying to run the following code in a C-shell script. The third echo statement should piece together the $f1 and $org_mod variables to form a Unix command containing two path names.

# compute azimuth for the start and end
set pin1 = `head -1 $2 | awk '{print $1,$2}'`
set f1 = `head -1 tmprecord`
echo $f1    # my addition
echo $org_mod   # my addition
echo "make_s1a_tops $f1/annotation/*iw1*"$org_mod"*xml $f1/measurement/*iw1*"$org_mod"*tiff tmp2 0"
make_s1a_tops $f1/annotation/*iw1*"$org_mod"*xml $f1/measurement/*iw1*"$org_mod"*tiff tmp2 0
ext_orb_s1a tmp2.PRM $orbit tmp2
set tmpazi = `echo $pin1 | awk '{print $1,$2,0}' | SAT_llt2rat tmp2.PRM 1 | awk '{printf("%d",$2+0.5)}'`
 # refine the calculation in case the pin is far away from the starting frame. (baseline error)
shift_atime_PRM.csh tmp2.PRM $tmpazi
set azi1 = `echo $pin1 | awk '{print $1,$2,0}' | SAT_llt2rat tmp2.PRM 1 | awk '{printf("%d",$2+0.5 + '$tmpazi')}'`

The shell output is as follows:

/mnt/d/Projecten/Bodemdaling/Working_directories/Hawaii/asc/data/S1A_IW_SLC__1SDV_20220919T043936_20220919T044006_045069_0562A9_C912.SAFE
vv
/measurement/*iw1*vv*tiff tmp2 0rojecten/Bodemdaling/Working_directories/Hawaii/asc/data/S1A_IW_SLC__1SDV_20220919T043936_20220919T044006_045069_0562A9_C912.SAFE
make_s1a_tops: No match.
 Couldn't open xml file:
 tmp2.PRM
couldn't open master.PRM

As can be seen the string does not formulate paths in the correct order, and also causes some changes such as "Projecten" ==> "0rojecten".

What could be the reason for this, and how could I print the string in the correct manner?

I added lines to separately print the variables to check whether these were OK. I tried to run the code with $f1 in quotation marks, but this did not produce better results.

tripleee
  • 175,061
  • 34
  • 275
  • 318
TijnN
  • 1
  • 1

0 Answers0