|
|
|
|
|
by unhammer
4112 days ago
|
|
Once you discover <() it's hard not to (ab)use it everywhere :-) # avoid temporary files when some program needs two inputs:
join -e0 -o0,1.1,2.1 -a1 -a2 -j2 -t$'\t' \
<(sort -k2,2 -t$'\t' freq/forms.${lang}) \
<(sort -k2,2 -t$'\t' freq/lms.${lang})
# gawk doesn't care if it's given a regular file or the output fd of some process:
gawk -v dict=<(munge_dict) -f compound_translate.awk <in.txt
# prepend a header:
cat <(echo -e "${word}\t% ${lang}\tsum" | tr [:lower:] [:upper:]) \
<(coverage ${lang})
|
|
Something wonderful I found out the other day: Bash executes scripts as it parses them, so you can do all kinds of awful things. For starters,
will have bash execute an infinite script that looks like without trying to load the whole thing first.After that, you can move onto having a script append to itself and whatever other dreadful things you can think of.