added checking whether it's shell script, removed unnecessary quote replacement