using sed to remove a strange token
How would one use sed to go about removing a token like: &word;
I've tried: 1. sed 's/&word;/ /' 2. sed 's/\&word\;/ /' things like that. Any suggestions? |
Umm, they both worked for me exactly as you have typed them :)
|
weird...
do you think it may be a problem if they are not separated by a space? For example, what if you have asghasgpn&word;asdgnapsd as your input. Will it still remove it? Thanks. |
yep, sure does
|
good grief this is weird :(
|
certainly. Do you have any aliases set up for the sed command?
Code:
alias | grep sed EDIT: nevermind version, I see it's probably ubuntu from your profile ;) |
actually, I just ssh'd to my school's server and I'm running it from there... so I'm not sure of the details. When I run the alias command as suggested, I get nothing.
|
oh.. and I'm not sure what version of sed either. I would use another tool like 'tr', but I don't think you can remove specific words with 'tr'.
|
Well if it's a school server, ask the system administrator what the heck is going on :). Have you tried the commands on your home box? Do you get different results?
|
All times are GMT -5. The time now is 04:56 PM. |