-
Junior Member
RE:deletion
how to delete a word in a file using shell scripting???
-
Junior Member
Re: deletion
Hi, you can try with sed and its substitution comand:
sed -e 's/word_to_be_deleted//' my_file
the s is the name of the command,
the expression between the first an second slashes (/) is the pattern to be replaced,
the expresion between the second and the third slashes (/) is the replacement pattern (in this case nothing).
The patterns could be regular expressions.
The standard output is the console, but you can redirect the output to another file using shell redirection. (> my_file_with_word_deleted)
HTH
-
Re: deletion
if you find sed utility command unuseful for that operation, I suggest the use of AWK if you are in the shell scripts.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules