gonzui


Format: Advanced Search

tkernel_2/etc/mergesrecbare sourcepermlink (0.00 seconds)

Search this content:

    1: #! /usr/bin/perl
    2: #
    3: # ----------------------------------------------------------------------
    4: #     T-Kernel 2.0 Software Package
    5: #
    6: #     Copyright 2011 by Ken Sakamura.
    7: #     This software is distributed under the latest version of T-License 2.x.
    8: # ----------------------------------------------------------------------
    9: #
   10: #     Released by T-Engine Forum(http://www.t-engine.org/) at 2011/05/17.
   11: #     Modified by T-Engine Forum at 2014/07/14.
   12: #     Modified by TRON Forum(http://www.tron.org/) at 2015/06/01.
   13: #
   14: # ----------------------------------------------------------------------
   15: #
   16: 
   17: #       mergesrec
   18: #
   19: #       merge S-Record format files to one file
   20: #
   21: #
   22: 
   23: $usage = "usage: mergesrec file ... > out\n";
   24: 
   25: $top = "";
   26: $end = "";
   27: 
   28: while ( <> ) {
   29:         if ( /^S0/ ) {
   30:                 if ( $top eq "" ) {
   31:                         $top = $_;
   32:                         print;
   33:                 }
   34:                 next;
   35:         }
   36:         if ( /^S7/ ) {
   37:                 $end = $_;
   38:                 next;
   39:         }
   40:         print;
   41: }
   42: 
   43: print $end;
   44: 
   45: exit 0;
   46: 
   47: