Changeset 4443 for palm/trunk/SCRIPTS
- Timestamp:
- Mar 5, 2020 3:31:21 PM (5 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/batch_scp
r3549 r4443 27 27 # ----------------- 28 28 # $Id$ 29 # add cycle number to initial files too (000), 30 # remove compatibility for cycle numbers which are less than three digits wide 31 # 32 # 3549 2018-11-21 15:44:44Z raasch 29 33 # english translation of german comments / variable names 30 34 # … … 427 431 then 428 432 (( maxcycle = icycle )) 429 430 # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS431 # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS432 if [[ $(echo $cycle | cut -c1) = 0 ]]433 then434 leading_zero=true435 else436 leading_zero=false437 fi438 433 fi 439 434 … … 464 459 (( maxcycle = usecycle )) 465 460 else 466 printf " >>> Un fied cycle number cannot be used\n"461 printf " >>> Unified cycle number cannot be used\n" 467 462 fi 468 463 fi 469 cyclestring=`printf ".%03d" $maxcycle` 470 else 471 if (( maxcycle == 0 )) 472 then 473 cyclestring="" 474 else 475 cyclestring=`printf ".%03d" $maxcycle` 476 fi 477 fi 464 fi 465 cyclestring=`printf ".%03d" $maxcycle` 478 466 else 479 467 if [[ $overwrite = false ]] … … 487 475 if [[ $absolut = false ]] 488 476 then 489 if (( maxcycle == 0 )) 490 then 491 cyclestring="" 492 else 493 494 # MAKE CYCLE NUMBER THREE DIGITS WIDE 495 if [[ $leading_zero = true ]] 496 then 497 cyclestring=`printf ".%03d" $maxcycle` 498 else 499 cyclestring=.$maxcycle 500 fi 501 (( maxcycle = 0 )) 502 fi 477 # MAKE CYCLE NUMBER THREE DIGITS WIDE 478 cyclestring=`printf ".%03d" $maxcycle` 503 479 else 504 480 cyclestring="" … … 511 487 then 512 488 (( maxcycle = usecycle )) 513 cyclestring=`printf ".%03d" $usecycle` 514 else 515 cyclestring="" 516 fi 489 fi 490 cyclestring=`printf ".%03d" $maxcycle` 517 491 518 492 # EXIT, IF FILE SHALL BE GET FROM THE TARGET HOST, BUT DOESN'T EXIST … … 526 500 527 501 528 # IF A FOLDER IS CREATED, THE FILENAME MUST NOT CONTAIN A CYCLE NUMBER IN529 # ANY CASE, SINCE IT CANNOT HAVE ONE530 if [[ $make_catalog = force ]]531 then532 cyclestring=""533 (( maxcycle = 0 ))534 fi535 536 537 502 # IF NAME-OPTION (-n) IS CHOSEN, ONLY DETERMINE THE LOCAL FILENAME ON THE 538 503 # TARGET HOST AND EXIT THE SCRIPT … … 630 595 if [[ $? != 0 ]] 631 596 then 632 # CHECK, OBIF FILE SIZES ON LOCAL HOST AND TARGET HOST MATCH597 # CHECK, IF FILE SIZES ON LOCAL HOST AND TARGET HOST MATCH 633 598 local_size=`ls -al $2` 634 599 local_size=`echo $local_size | cut -d" " -f5` -
palm/trunk/SCRIPTS/palmrun
r4425 r4443 27 27 # ----------------- 28 28 # $Id$ 29 # add cycle number to initial files too (000), 30 # remove compatibility for cycle numbers which are less than three digits wide 31 # 32 # 4425 2020-02-26 15:35:00Z raasch 29 33 # hard coded path to the fileconnection file replaced by a path that is based on 30 34 # the source path which has been given in the configuration file … … 1355 1359 while read line 1356 1360 do 1357 1358 1361 # filename without path (i.e. after the last "/") 1362 basefilename=$(basename ${line}) 1359 1363 1360 1361 1362 1363 1364 1365 1364 # check if there is an extension 1365 extension=${basefilename##*.} 1366 if [[ "$extension" = "${extin[$nr_of_input_files]}" ]] 1367 then 1368 basefilename=${basefilename%.*} 1369 fi 1366 1370 1367 # check for an existing cycle number 1368 cycle=${basefilename##*.} 1369 if [[ $cycle =~ ^-?[0-9]+$ ]] 1370 then 1371 # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS 1372 # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10 1373 (( icycle = $((10#$cycle)) )) 1374 else 1375 (( icycle = 0 )) 1376 fi 1371 # check for an existing cycle number 1372 cycle=${basefilename##*.} 1373 if [[ $cycle =~ ^-?[0-9]+$ ]] 1374 then 1375 # NUMBERS WITH LEADING ZEROS ARE INTERPRETED AS OCTAL NUMBERS 1376 # 10# EXPLICITLY SPECIFIES THE NUMBER BASE AS 10 1377 (( icycle = $((10#$cycle)) )) 1378 explicit_cycle_number=true 1379 else 1380 (( icycle = 0 )) 1381 explicit_cycle_number=false 1382 fi 1377 1383 1378 if (( icycle > maxcycle )) 1379 then 1380 (( maxcycle = icycle )) 1381 1382 # FOR COMPATIBILITY REASONS WITH OLDER VERSIONS 1383 # CHECK IF CYCLE NUMBER CONTAINS LEADING ZEROS 1384 if [[ $(echo $cycle | cut -c1) = 0 ]] 1385 then 1386 leading_zero=true 1387 else 1388 leading_zero=false 1389 fi 1390 fi 1384 if (( icycle > maxcycle )) 1385 then 1386 (( maxcycle = icycle )) 1387 fi 1391 1388 1392 1389 done <filelist 1393 1390 rm filelist 1391 1394 1392 1395 1393 # MAKE CYCLE NUMBER THREE DIGITS WIDE 1396 if [[ $leading_zero = true ]] 1397 then 1398 cyclestring=`printf "%03d" $maxcycle` 1399 else 1400 cyclestring=$maxcycle 1401 fi 1394 cyclestring=`printf "%03d" $maxcycle` 1395 1402 1396 1403 1397 # APPEND CYCLE NUMBER TO FILENAME 1404 if (( maxcycle > 0 ))1398 if [[ $explicit_cycle_number = true ]] 1405 1399 then 1406 1400 if [[ "${extin[$nr_of_input_files]}" != " " && "${extin[$nr_of_input_files]}" != "" ]] … … 1420 1414 # IS LATER USED FOR TRANSFERRING FILES WIHIN THE JOB (SEE END OF FILE) 1421 1415 absnamein[$nr_of_input_files]=$filename 1422 if (( maxcycle > 0 ))1416 if [[ $explicit_cycle_number = true ]] 1423 1417 then 1424 1418 if [[ "${actionin[$nr_of_input_files]}" = di ]] … … 1996 1990 if [[ $running_in_batch_mode = false ]] 1997 1991 then 1992 1998 1993 # CREATE THE DIRECTORY 1999 1994 mkdir -p $tempdir … … 2166 2161 ln -f ${absnamein[$i]} ${localin[$i]} 2167 2162 fi 2168 # I f "ln -f" fails or if "$link_local_input = false" do a normal"cp"2163 # IF "ln -f" FAILS OR IF "$link_local_input = false" DO A NORMAL "cp" 2169 2164 if [[ ! -f "${localin[$i]}" ]] 2170 2165 then … … 2494 2489 ls -1 -d $filename > filelist 2>/dev/null 2495 2490 ls -1 -d $filename.* >> filelist 2>/dev/null 2491 (( maxcycle = 0 )) 2496 2492 while read line 2497 2493 do … … 2531 2527 if [[ "${actionout[$i]}" = a ]] 2532 2528 then 2533 (( maxcycle = maxcycle - 1 )) 2529 if (( maxcycle > 0 )) 2530 then 2531 (( maxcycle = maxcycle - 1 )) 2532 fi 2534 2533 fi 2535 2534 … … 2554 2553 fi 2555 2554 fi 2556 if (( cycnum[$i] > 0 )) 2557 then 2558 cyclestring=`printf "%03d" ${cycnum[$i]}` 2559 pathout[$i]=${pathout[$i]}.$cyclestring 2560 fi 2561 fi 2555 cyclestring=`printf "%03d" ${cycnum[$i]}` 2556 pathout[$i]=${pathout[$i]}.$cyclestring 2557 fi 2562 2558 2563 2559 # CHECK FOR SINGLE FILE (SERIAL RUN) OR DIRECTORY (ONE FILE PER CORE FOR PARELLEL EXECUTION)
Note: See TracChangeset
for help on using the changeset viewer.