File: arb_fig

package info (click to toggle)
arb 6.0.6-8
  • links: PTS, VCS
  • area: non-free
  • in suites: sid, trixie
  • size: 66,204 kB
  • sloc: ansic: 394,911; cpp: 250,290; makefile: 19,644; sh: 15,879; perl: 10,473; fortran: 6,019; ruby: 683; xml: 503; python: 53; awk: 32
file content (38 lines) | stat: -rwxr-xr-x 699 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash

editlines() {
    IFS=" "
    read FIG
    while [ ! -z "$FIG" ]; do
        # echo "FIG='$FIG'"
        xfig $FIG &
        read FIG
    done
}

expandfig() {
    local FNAME=${1%.fig}.fig
    find $ARBHOME/lib/pictures -name "$FNAME"
}

expandfigs() {
    expandfig $1
    shift
    if [ ! -z "$1" ]; then
        expandfigs $*
    fi
}


if [ -z "$ARBHOME" ]; then
    echo '$ARBHOME not set'
else
    if [ -z "$1" ]; then
        echo "Usage: arb_fig [xxx[.fig]]+"
        echo "Edit all given figs using xfig"
        echo "If a fig occurs multiple times, all get edited"
    else
        expandfigs $* | editlines
        FIG=`find $ARBHOME/lib/pictures -name "$FNAME"`
    fi
fi