Code Sample |
find ./ -name "*.h" | \ while read i; do \ cpp -P -fpreprocessed "$i" > "$i.tmp" \ && mv "$i.tmp" "$i"; done find ./ -name "*.h" | \ while read i; do \ sed -i '/^ *$/d' "$i"; done |
Code Sample |
cpp -P -fpreprocessed "$i" > "$i.tmp" && mv "$i.tmp" "$i"; done |
Code Sample |
sed -i '/^ *$/d' "$i" |
Code Sample |
for i in "$@"; do sed -i '/^ *$/d' "$i"; done |
Code Sample |
for i in "$@"; do sed -i -e 's/\t*#.*//g' \ -e 's/\ *#.*//g' \ -e '/^#/d' \ -e '/^\t*#/d' \ -e '/^ *#/d' \ -e '/^ *$/d' \ "$i"; done |
Code Sample |
#!/bin/sh |
Quote |
#!/bin/sh ext=h case $1 in -h* | --h*) cat << EOF Use $0 in the top directory of your sources to strip all headers of comments. $0 -ext sh operates on .sh files instead of .h EOF ;; -ext) ext=$2;; esac find -name "*.$ext" | \ while read i; do \ cpp -P -fpreprocessed "$i" > "$i.tmp" mv "$i.tmp" "$i"; done find -name "*.$ext" | \ while read i; do \ sed -i -e '/^ *$/d' -e '/^# /d' "$i"; done |
Code Sample |
cpp -P -fpreprocessed |