Slash in variable

view story

http://ubuntuforums.org – Hi, I am writing following script: Code: huangyingw@laptop:~/bashrc$ cat fr.sh #! /bin/sh file=/home/huangyingw/myproject/git/test_fr/makefile sed -i "s/"$1"/"$2"/gi" $file huangyingw@laptop:~/bashrc$ And passing following parameter to it, then I got the error. Code: huangyingw@laptop:~/myproject/git/test_fr$ fr ~/myproject/git/makefile/GNU_makefile_template ~/myproject/git/GNU_makefile_template sed: -e expression #1, char 9: unknown option to `s' huangyingw@laptop:~/myproject/git/test_fr$ I think it is caused by the special character (Hardware)