File size: 528 Bytes
7bcf8d7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
# Created by Thamme Gowda on June 17, 2019

DIR=$(dirname "${BASH_SOURCE[0]}")  # get the directory name
# DIR=$(realpath "${DIR}")    # resolve its full path if need be

if [[ $# -lt 1 || $# -gt 2 ]]; then
    >&2 echo "ERROR: invalid args"
    >&2 echo "Usage: <input.tsv> [<output.tsv>]"
    exit 2
fi

INP=$1
OUT=$2

CMD=$DIR/uroman.pl

function romanize(){
    paste <(cut -f1 $INP) <(cut -f2 $INP | $CMD)
}

if [[ -n $OUT ]]; then
    romanize > $OUT
else
    romanize
fi