sed
doesn't haven an -i
option.
You are probably using some vendor-specific variant of sed
. If you want to use the vendor-specific non-standardized extensions of your vendor-specific non-standardized variant of sed
, you need to make sure that you install said vendor-specific non-standardized variant and need to make sure that you call it and don't call the standards-compliant version of sed
that is part of your operating environment.
Note that as always when using non-standardized vendor-specific extensions, there is absolutely no guarantee that your code will be portable, which is exactly the problem you are seeing.
In this particular case, however, there is a much better solution: use the right tool for the job. sed
is a stream editor (that's why it is called "sed"), i.e. it is for editing streams, not files. If you want to edit files, use a file editor, such as ed
:
ed FILE <<-HERE
,s/.shayam.//g
w
q
HERE
See also: