X-Git-Url: http://git.harvie.cz/?p=mirrors%2Flibpurple-core-answerscripts.git;a=blobdiff_plain;f=list_vars.sh;fp=list_vars.sh;h=41e633cd3f3e9f88489033d64aaca91388744701;hp=0000000000000000000000000000000000000000;hb=7f54aeea04518240219b8c8c4b3a36903a842dad;hpb=b9de4161887e9793f7792ebb743525a1cb62c8a0 diff --git a/list_vars.sh b/list_vars.sh new file mode 100755 index 0000000..41e633c --- /dev/null +++ b/list_vars.sh @@ -0,0 +1,11 @@ +#!/bin/bash +file='answerscripts.c' +pipe=cat +[ -n "$1" ] && pipe='sed -e s/_/\\_/g' +pre="$(grep ENV_PREFIX "$file" | head -n 1 | cut -d '"' -f 2)" +grep setenv "$file" | while read line; do + var="$(echo "$line" | cut -d '"' -f 2)"; + wtf="$(echo "$line" | cut -d ';' -f 2 | cut -d '/' -f 3-)"; + echo -n "$1* $pre$var"; + [ -n "$wtf" ] && echo -e "\t($wtf)" || echo +done | $pipe