bash - Sed command is making changes to the original script -


can suggest how make sure particular command in shell script not effect script called? example in case replacing occurrences of particular word other word, using "sed" command. don't want changing in original script.

use basename $0 in script. example current directory:

#!/bin/bash files="*" current=`basename $0` f in $files   if [ -f $f ] && [ $f != $current ]       #some sed action file   fi done 

Comments

Popular posts from this blog

java - Ebean enhancement ignores a model -

javascript - Reference error while trying to encapsulate an animation function -

SQL php on different pages to Insert (mysqli) -