Hi I'm new to using
When I type:
echo day | sed /s/day/night/
the output is:
In other words, it just appends the entire line after the substitution. I am using a Samsung Galaxy Tab A, running Android 6.01. When I type
which sed I get
/system/bin/sed and when I type
sed --version I get
This is not GNU sed version 9.0.
I saw a couple posts about this already online. And people were saying this might be a buggy version of sed. Are there any other ways to do search and replace in shell scripts (or just an automated fashion) on an android tablet?
I installed something called "busybox" which provides something called
ed, but again, I was having problems doing the substitution command. It would work sometimes, but other times it would say "no substitutions found for ___ (short, basic regex statement I got from a book which is supposed to be compatible with all versions of regex - okay, that sounds vague here's the regex statement:
^.*\bthe\b.*$ (The file contains lots of "the" words.)
I guess my options are: A) try to install linux onto this tablet, B) don't use the tablet at all, C) keep looking for software that will do automated search and replaces on the tablet or try to identify what the bug is in sed and if there's a special code word it needs to work right, D) ?
EDIT: Added info per request: When I typed
echo day | od -c
37777776620 d a y \n 37777776620
When I typed
echo day | sed 's/day/night/' | od -c
37777776620 n i g h t \0 d a y \n 37777776620
I hear you on the copy and paste recommendation, but I couldn't seem to do copy or paste in this "terminal emulator" app.