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
Post a Comment