ipkg doesn't like underscores in package names
[openadk.git] / scripts / strip-script.sh
blob355df0e73d5087ea00e0523280d51673d8b88e78
1 # Copyright (c) 2007
2 # Thorsten Glaser <tg@mirbsd.de>
4 # Provided that these terms and disclaimer and all copyright notices
5 # are retained or reproduced in an accompanying document, permission
6 # is granted to deal in this work without restriction, including un-
7 # limited rights to use, publicly perform, distribute, sell, modify,
8 # merge, give away, or sublicence.
10 # Advertising materials mentioning features or use of this work must
11 # display the following acknowledgement:
12 # This product includes material provided by Thorsten Glaser.
13 # This acknowledgement does not need to be reprinted if this work is
14 # linked into a bigger work whose licence does not allow such clause
15 # and the author of this work is given due credit in the bigger work
16 # or its accompanying documents, where such information is generally
17 # kept, provided that said credits are retained.
19 # This work is provided "AS IS" and WITHOUT WARRANTY of any kind, to
20 # the utmost extent permitted by applicable law, neither express nor
21 # implied; without malicious intent or gross negligence. In no event
22 # may a licensor, author or contributor be held liable for indirect,
23 # direct, other damage, loss, or other issues arising in any way out
24 # of dealing in the work, even if advised of the possibility of such
25 # damage or existence of a defect, except proven that it results out
26 # of said person's immediate fault when using the work as intended.
27 # Shell script to strip down a shell script (filter).
29 shopt -s extglob
30 cat "$@" | while read -r _line; do
31 set -o noglob
32 [[ $_line = \#* && $_line != @(#!)* ]] && continue
33 [[ -n $_line ]] && builtin printf '%s\n' "$_line"
34 done
35 exit 0