Reputation: 11
I'm a novice in programming. I'm trying to remove *
character in my text file using sed
but to no avail, and keep getting this :
sed: -e expression #1, char 1: unknown command: `*'.
Please help?Thanks
Upvotes: 1
Views: 124
Reputation: 335
You can also escape the shell meta characters by character class [] in sed
sed 's/[*]//g' filename
Upvotes: 0
Reputation: 41
The problem is that '*' is a special shell character and will be processed before the sed command. To combat this, use the escape character '\' before the '*' so it will be ignored by the shell and processed as a part of the sed command:
sed 's/\*//g' fileName
Upvotes: 3