Ignore:
Timestamp:
Mar 18, 2007 11:44:44 PM (18 years ago)
Author:
raasch
Message:

scripts are running under pdksh

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/mbuild

    r67 r69  
    8484     # 14/03/07 - Siggi - fimm admitted, revision number added to terminal
    8585     #                    output
     86     # 16/03/07 - Siggi - adjustments (netcdf) for lctit
     87     #                    adjustments for running under pdksh, local ip-addres
     88     #                    is not determined any more
    8689
    8790
     
    113116    # FEHLERBEHANDLUNG
    114117    # BEI EXIT:
    115  trap 'if [[ $locat != normal ]]
     118 trap 'rm -rf  tmp_mbuild
     119       if [[ $locat != normal ]]
    116120       then
    117121          printf "\n\n +++ mbuild killed \n\n"
     
    122126
    123127    # BEI TERMINAL-BREAK:
    124  trap 'printf "\n\n +++ mbuild killed by \"^C\" \n\n"
     128 trap 'rm -rf  tmp_mbuild
     129       printf "\n\n +++ mbuild killed by \"^C\" \n\n"
    125130       exit
    126131      ' 2
     
    156161    # LOKALEN RECHNER ERMITTELN
    157162 local_host_real_name=$(hostname)
    158  local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     163# local_addres=$(nslookup `hostname` 2>&1 | grep "Address:" | tail -1 | awk '{print $2}')
     164
    159165 case  $local_host_real_name  in
    160166     (atmos)                    local_host=lcide;;
     
    163169     (fimm.bccs.uib.no)         local_host=lcmuk;;
    164170     (gate)                     local_host=neck;;
    165      (gfdl3.yonsei.ac.kr)       local_host=decalpha; local_addres=165.132.26.56;;
    166      (gfdl5)                    local_host=ibmy; local_addres=165.132.26.58;;
     171     (gfdl3.yonsei.ac.kr)       local_host=decalpha;;
     172     (gfdl5)                    local_host=ibmy;;
    167173     (gwdk081.gwdg.de)          local_host=ibm;;
    168174     (hreg01a-en0|hreg02a-en0)  local_host=ibmh;;
     
    200206    # BENUTZERNAMEN AUF LOKALEM RECHNER AUS KONFIGURATIONSDATEI ERMITTELN
    201207 line=""
    202  grep  " $local_host" $config_file | grep "%remote_username"  |  while read line
     208 grep  " $local_host" $config_file | grep "%remote_username"  >  tmp_mbuild
     209 while read line
    203210 do
    204211    if [[ "$line" != ""  ||  $(echo $line | cut -c1) != "#" ]]
     
    206213       local_username=`echo $line | cut -d" " -s -f2`
    207214    fi
    208  done
     215 done < tmp_mbuild
    209216
    210217 if [[ "$local_username" = "" ]]
     
    222229    # VARIABLEN SETZEN, WEIL DIESE EVTL. IN PFADNAMEN VERWENDET WERDEN
    223230 line=""
    224  grep "%" $config_file  |  while read line
     231 grep "%" $config_file  >  tmp_mbuild
     232 while read line
    225233 do
    226234    if [[ "$line" != ""  &&  "$(echo $line | cut -d" " -s -f3)" = "" ]]
     
    231239#       eval echo \"   $var=\$$var \"   # AUSGABE ZU TESTZWECKEN
    232240    fi
    233  done
     241 done < tmp_mbuild
    234242
    235243    # NUN PRUEFEN, OB EIN GLOBALER QUELLTEXTPFAD VEREINBART WURDE
    236244 line=""
    237  grep "%source_path" $config_file  |  while read line
     245 grep "%source_path" $config_file  >  tmp_mbuild
     246 while read line
    238247 do
    239248    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    244253       fi
    245254    fi
    246  done
     255 done < tmp_mbuild
    247256
    248257 line=""
    249  grep  " $local_host" $config_file | grep "%source_path"  |  while read line
     258 grep  " $local_host" $config_file | grep "%source_path"  >  tmp_mbuild
     259 while read line
    250260 do
    251261    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    253263       local_source_path=`echo $line | cut -d" " -s -f2`
    254264    fi
    255  done
     265 done < tmp_mbuild
    256266
    257267 if [[ "$local_source_path" = "" ]]
     
    273283     # EBENSO PFAD FUER DAS MAKE-DEPOSITORY ERMITTELN
    274284 line=""
    275  grep "%depository_path" $config_file  |  while read line
     285 grep "%depository_path" $config_file  >  tmp_mbuild
     286 while read line
    276287 do
    277288    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    282293       fi
    283294    fi
    284  done
     295 done < tmp_mbuild
    285296
    286297 line=""
    287  grep  " $local_host" $config_file | grep "%depository_path"  |  while read line
     298 grep  " $local_host" $config_file | grep "%depository_path"  >  tmp_mbuild
     299 while read line
    288300 do
    289301    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    291303       local_depository_path=`echo $line | cut -d" " -s -f2`
    292304    fi
    293  done
     305 done < tmp_mbuild
    294306
    295307 if [[ "$local_depository_path" = "" ]]
     
    628640 printf "\n  *** scanning configuration file for host(s) ..."
    629641
    630  grep  %fopts  $config_file  |  while read line
     642 grep  %fopts  $config_file  >  tmp_mbuild
     643 while read line
    631644 do
    632645       # KOMMENTARZEILEN UEBERSPRINGEN
     
    634647    (( ihost = ihost + 1 ))
    635648    hostline[$ihost]="$line"
    636  done
     649 done < tmp_mbuild
    637650
    638651 
     
    699712                         fi;;
    700713        (lctit)          remote_addres=172.17.75.161; netcdf_support=true
    701                          netcdf_path=/home/usr5/mkanda/netcdf-3.6.1/src; cpp_options="-Mpreprocess";;
     714                         netcdf_path=/home/usr5/mkanda/netcdf-3.6.2; cpp_options="-Mpreprocess";;
    702715        (decalpha)       remote_addres=165.132.26.56; cpp_options="-cpp"; netcdf_support=true
    703716                         netcdf_path=/usr/local/netcdf-3.5.1;;
     
    728741       # REMOTE-USERNAMEN ERMITTELN
    729742    line=""
    730     grep  "$remote_host_string" $config_file | grep "%remote_username"  |  while read line1
     743    grep  "$remote_host_string" $config_file | grep "%remote_username"  >  tmp_mbuild
     744    while read line1
    731745    do
    732746       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    734748          line="$line1"
    735749       fi
    736     done
     750    done < tmp_mbuild
    737751
    738752    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
     
    749763    line=""
    750764    remote_source_path=""
    751     grep  "$remote_host_string" $config_file | grep "%source_path"  |  while read line1
     765    grep  "$remote_host_string" $config_file | grep "%source_path"  >  tmp_mbuild
     766    while read line1
    752767    do
    753768       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    755770          line="$line1"
    756771       fi
    757     done
     772    done < tmp_mbuild
    758773
    759774    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    780795    remote_md=""
    781796    line=""
    782     grep  "$remote_host_string" $config_file | grep "%depository_path"  |  while read line1
     797    grep  "$remote_host_string" $config_file | grep "%depository_path"  >  tmp_mbuild
     798    while read line1
    783799    do
    784800       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    786802          line="$line1"
    787803       fi
    788     done
     804    done < tmp_mbuild
    789805
    790806    if [[ "$line" != ""  &&  $(echo $line | cut -c1) != "#" ]]
     
    810826       # COMPILERNAMEN ERMITTELN
    811827    line=""
    812     grep  "$remote_host_string" $config_file | grep "%compiler_name "  |  while read line1
     828    grep  "$remote_host_string" $config_file | grep "%compiler_name "  >  tmp_mbuild
     829    while read line1
    813830    do
    814831       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    816833          line="$line1"
    817834       fi
    818     done
     835    done < tmp_mbuild
    819836
    820837    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
     
    833850    then
    834851       line=""
    835        grep  "$remote_host_string" $config_file | grep "%compiler_name_ser"  |  while read line1
     852       grep  "$remote_host_string" $config_file | grep "%compiler_name_ser"  >  tmp_mbuild
     853       while read line1
    836854       do
    837855          if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    839857             line="$line1"
    840858          fi
    841        done
     859       done < tmp_mbuild
    842860
    843861       if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
     
    923941       # COMPILEROPTIONEN ERMITTELN
    924942    line=""
    925     grep  "$remote_host_string" $config_file | grep "%fopts"  |  while read line1
     943    grep  "$remote_host_string" $config_file | grep "%fopts"  >  tmp_mbuild
     944    while read line1
    926945    do
    927946       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    929948          line="$line1"
    930949       fi
    931     done
     950    done < tmp_mbuild
    932951    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
    933952    then
     
    947966          (ibmy)      compiler_options="-I ${netcdf_path}/include  $compiler_options";;
    948967          (lcmuk)     compiler_options="-I ${netcdf_path}/include  $compiler_options";;
    949           (lctit)     compiler_options="-I ${netcdf_path}/f90      $compiler_options";;
     968          (lctit)     compiler_options="-I ${netcdf_path}/include  $compiler_options";;
    950969          (nech|neck) compiler_options="-I ${netcdf_path}/include  $compiler_options";;
    951970       esac
     
    956975       # LADER-OPTIONEN ERMITTELN
    957976    line=""
    958     grep  "$remote_host_string" $config_file | grep "%lopts"  |  while read line1
     977    grep  "$remote_host_string" $config_file | grep "%lopts"  >  tmp_mbuild
     978    while read line1
    959979    do
    960980       if [[ $(echo $line1 | cut -d" " -s -f3-) = "$remote_host_string" ]]
     
    962982          line="$line1"
    963983       fi
    964     done
     984    done < tmp_mbuild
    965985
    966986    if [[ "$line" = ""  ||  $(echo $line | cut -c1) = "#" ]]
     
    9801000          (ibms)                       loader_options="$loader_options -L${netcdf_path} -lnetcdf";;
    9811001          (ibmy)                       loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
    982           (lctit)                      loader_options="$loader_options -L${netcdf_path}/libsrc -lnetcdf";;
     1002          (lctit)                      loader_options="$loader_options -L${netcdf_path}/lib -lnetcdf";;
    9831003       esac
    9841004    fi
Note: See TracChangeset for help on using the changeset viewer.