l 5 acronym: refactor code

This commit is contained in:
lassulus 2016-04-13 16:48:32 +02:00
parent 9717e5a2e0
commit 2e87439340

View File

@ -1,13 +1,16 @@
{ pkgs, ... }:
pkgs.writeScriptBin "acronym" ''
#! ${pkgs.bash}/bin/bash
acro=$1
curl -s http://www.acronymfinder.com/$acro.html \
| grep 'class="result-list__body__rank"' \
| sed 's/.*title="\([^"]*\)".*/\1/' \
| sed 's/^.* - //' \
| sed "s/'/'/g"
| grep 'class="result-list__body__rank"' \
| sed '
s/.*title="\([^"]*\)".*/\1/
s/^.* - //
s/'/'\'''/g
'
''