[Assorted-commits] SF.net SVN: assorted:[1676] shell-tools/trunk/src/bash-commons/common.bash
Brought to you by:
yangzhang
From: <yan...@us...> - 2010-06-04 02:16:06
|
Revision: 1676 http://assorted.svn.sourceforge.net/assorted/?rev=1676&view=rev Author: yangzhang Date: 2010-06-04 02:15:59 +0000 (Fri, 04 Jun 2010) Log Message: ----------- in-place Modified Paths: -------------- shell-tools/trunk/src/bash-commons/common.bash Modified: shell-tools/trunk/src/bash-commons/common.bash =================================================================== --- shell-tools/trunk/src/bash-commons/common.bash 2010-06-03 19:28:52 UTC (rev 1675) +++ shell-tools/trunk/src/bash-commons/common.bash 2010-06-04 02:15:59 UTC (rev 1676) @@ -634,6 +634,13 @@ done } +# Edit files in-place. +in-place() { + local file="$1" + shift + "$@" < "$file" > "$file.tmp" && mv "$file.tmp" "$file" +} + #if ! is_declared indent ; then # noindent #else This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |