This repository has been archived on 2023-11-20. You can view files and clone it, but cannot push or open issues or pull requests.
foam-extend4.1-coherent-io/bin/tools/replaceAllShellSun

16 lines
596 B
Text
Raw Normal View History

#!/usr/xpg4/bin/sh
# Replace all shell script headers with
if [ $# -ne 1 -o ! -d "$1" ]; then
echo "Usage: `basename $0` <dir>"
echo ""
echo "Replaces all occurrences of #!/bin/sh with #!/usr/xpg4/bin/sh inside a directory tree."
exit 1
fi
#- note that below does not work since {} does not get replaced
#find $1 -type f -exec /usr/xpg4/bin/sh -c "grep '^#\!/bin/sh' {} >/dev/null && echo {} && mv {} {}_bak && sed -e 's@^#\!/bin/sh@#\!/usr/xpg4/bin/sh@' {}_bak > {}" ';'
find $1 -exec $WM_PROJECT_DIR/bin/tools/inlineReplace '^#\!/bin/sh' '#\!/usr/xpg4/bin/sh' {} \; -print