Skip to content

Commit

Permalink
Make "pp/generate-pp.sh" shell script POSIX compliant.
Browse files Browse the repository at this point in the history
  • Loading branch information
nekonomicon committed Dec 22, 2023
1 parent e858db1 commit b427abb
Showing 1 changed file with 5 additions and 11 deletions.
16 changes: 5 additions & 11 deletions tools/generate-pp.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash
#!/bin/sh

generate()
{
Expand All @@ -17,21 +17,15 @@ generate()
sed -e "s/__APPNAME__/$APPNAME/" < base.html | sed -e "s/__TYPE__/$TYPE/" > "$FILENAME"
}

parseline()
{
IFS='|'
readarray ITEM <<< $1
generate ${ITEM[0]} ${ITEM[1]} ${ITEM[2]}
}

main()
{
IFS="|"
cat list.txt | while read -a line; do
generate "${line[0]}" "${line[1]}" "${line[2]}"
done
while read -r word0 word1 word2; do
generate "$word0" "$word1" "$word2"
done < list.txt

unset IFS
}

main "$@"

0 comments on commit b427abb

Please sign in to comment.