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

c++ - No viable overloaded operator for references a map -

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - Cannot secure connection using TLS -