Commit | Line | Data |
---|---|---|
7f54aeea H |
1 | #!/bin/bash |
2 | file='answerscripts.c' | |
3 | pipe=cat | |
4 | [ -n "$1" ] && pipe='sed -e s/_/\\_/g' | |
5 | pre="$(grep ENV_PREFIX "$file" | head -n 1 | cut -d '"' -f 2)" | |
6 | grep setenv "$file" | while read line; do | |
7 | var="$(echo "$line" | cut -d '"' -f 2)"; | |
8 | wtf="$(echo "$line" | cut -d ';' -f 2 | cut -d '/' -f 3-)"; | |
9 | echo -n "$1* $pre$var"; | |
10 | [ -n "$wtf" ] && echo -e "\t($wtf)" || echo | |
11 | done | $pipe |