Date:2012-04-18 02:28:52 (7 years 5 months ago)
Author:Werner Almesberger
Commit:33f9ac4876d89e7072567037c2e1724d99c1542d
Message:scripts/dcm2desc: script to convert comments from .dcm files to genex descriptions

Files: scripts/dcm2desc (1 diff)

Change Details

scripts/dcm2desc
1#!/bin/sh
2#
3# dcm2desc - Convert .dcm files to genex descriptions
4#
5# Copyright 2012 by Werner Almesberger
6#
7# This program is free software; you can redistribute it and/or modify
8# it under the terms of the GNU General Public License as published by
9# the Free Software Foundation; either version 2 of the License, or
10# (at your option) any later version.
11#
12
13
14usage()
15{
16    echo "usage: $0 [-L libdir ...] [-l lib ...]" 1>&2
17    exit 1
18}
19
20
21scan_dcm()
22{
23    for n in "$@"; do
24        sed -e '/^\$CMP /{s///;x;}' \
25            -e '/^[DKF] /{s///;x;G;s/\n/: /;p;s/: .*//;x;}' \
26            -e d <"$n"
27    done
28}
29
30
31while [ "$1" ]; do
32    case "$1" in
33    -L) shift
34        [ "`echo \"$1\"/*.dcm`" != "$1/*.dcm" ] &&
35            scan_dcm "$1"/*.dcm;;
36    -l) shift
37        scan_dcm "$1";;
38    -*) usage;;
39    *) usage;;
40    esac
41    shift
42done
43
44exit 0

Archive Download the corresponding diff file

Branches:
master



interactive