Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Cool cool. I'm using the new .bashrc file and I am still getting the whoami: unknown uid 10066 {I'm guessing its just my user?, because su returns unknown uid 0 (root i believe)}, but bash does seem to be working for the most part. The only thing that I can think of (based only on reading this thread though) is that I need to type ls $sd instead of ls sd.
Also, I am not getting the colors any more. I'm looking at the file in Notepad ++ to see if anything pops out at me (not that it will lol)
On a side note, does anyone know if the sense camera app will work on aosp roms?
(I do have to agree with you guys about miui looking too much like an iphone, but i'm using adw so it doesn't bother me too much -it's only in the menus now-)
Ah, ok, well I was wrong about why it didn't work. Who knows why my typo actually worked. That's kind of funny. Anyway, let's do two things here. First, open the terminal and type whoami, then do the same after typing su and enter. Let me know the exact output for both. As for ls sd, you can't do that. The shopt option only allows you to cd to a variable path, so cd sd works, but ls sd doesn't. Otherwise, you just have to do ls $sd.
As for the camera, I don't know off hand, but my initial response would be that it wouldn't work. You're welcome to try it, though. It really depends on how integrated into the system the particular app is. Some Sense apps rely heavily on the modifications HTC made to Android. Others may not. You can try copying the apk to CM and see if it works. Just make a backup, first.
Okay, here's the screen shot. If bash is at /system/xbin/bash, where should the PATH be?Hah! Okay, so MIUI reports UID 0 (aka root) rather than the actual name of the user. That's funny. I'll have to fix that. Is that the *exact* spelling and case? Can you actually give me a screenshot of what it returned? It's a pretty easy fix.
EDIT: hehe, yeah, it's going to give that error every time .bashrc has to load, so it'll do it when you first open the terminal, and right after you type su. You probably won't get it again unless you exit out of su, then go back again.

Okay, here's the screen shot. If bash is at /system/xbin/bash, where should the PATH be?
View attachment 18075
(never attached something before, hope it works)
Type:
echo $PATH
if you want to see what's in it. I'm sure it includes /system/bin and /system/xbin, at the very least. If you can run bash by just typing bash, then it's definitely there. I'd be extremely surprised if it wasn't. BTW, you can add whatever you want to $PATH in your .bashrc. There's little need to in Android, but it's a common practice in a normal Linux environment.
Anyway, is that you typing whoami, or is that output after loading the terminal and typing su? What happens if you actually type "whoami" from the terminal, yourself?
EDIT: I think whoami is a bit confused here. Let me know what happens when you actually run "whoami"

Okay, here we go.
View attachment 18078
Okay, well you have a slightly different version of busybox than me. I don't know if it's has something to do with that version of busybox or MIUI's implementation. I can't tell without doing some testing. So, I'll go ahead and make a version that can detect both kinds of output. I might not have it ready until tomorrow. Until then, go ahead and use the version I posted above. That will just show the green highlight for all users, but without the error.
Cool, works great. The error message is gone, and the color really isn't a big deal, so no rush on that. Again, this is a huge time saver, especially the sr and sw aliases, huge time saver.
(I actually have been turning the phone off, booting into recovery and mounting system through amon ra becasue I could never remember the exact command for that)
:/
. I'll try to get it fixed so the color changes for you. I'm sure you're not the only one who could have this problem. If my make any more modifications, I'll be sure to post an update here.Hehe, yeah it's not an easy one to remember. How would mounting it in recovery help? That just mounts it while you're boot in recovery. It shouldn't stick once you boot up. I'm glad you're actually using this and its helpful. I'll try to get it fixed so the color changes for you. I'm sure you're not the only one who could have this problem. If my make any more modifications, I'll be sure to post an update here.
`whoami` == "root"
`whoami` == '0'
Yeah, well that was the thing. Anytime I would ADB something, I'd boot into recover first, so I could mount /system. Talk about wasting time. I'm sure I'll find some way to remember it. >.>
I went into n++ and tried changing the line ...
toCode:`whoami` == "root"
but that didn't work. I figured I didn't want the back quotes cuz 0 isn't a command and I figured that the double quotes would be wrong (but I am still just making echo scripts right now ..total noob...)Code:`whoami` == '0'
Even if it did work, it would probably only work for this one issue. Eh... I'll go back to my echo "Today is `date`" scripts. lol
. If you're using adb, and you need to change something in /system, you can just run:
. I got so tired of typing out that long command (or leaving the terminal and coming back) which is why I made that alias.
. The easiest thing to do will probably be to use sed (or awk).Ahh okay. Yeah I'll definitely be looking around with it.
Googleing sed and awk right now lol
By the way, when I adb shell, then ls, all my results are like this...
[1;34macct(arrow < that way)[0m
any idea about that? lol
I actually get nothing..?Oh, that's funny. I don't have adb set up on this computer, anymore, but if you run adb shell, what happens if you run this:
echo $SHELL
If is says bash, then...well...that's weird. If it says sh, then just run bash. That's weird that it knew to use your .bashrc. Basically, sh can't interpret the codes in PS1 meant for bash, which is what I'm guessing the problem.
# echo $SHELL
echo $SHELL
#
[~]$ su
bash: [: too many arguments
[~]#
. The output of that is a little easier to parse than that weird output from whoami. We can probably use this.1) Okay, what happens if you just run bash?
2) id -u doesn't work because the output isn't *exactly* "0", and it still has too many actual strings, so it can't be used that way (at least, without quotes to make it one string). You're close, though. The output of that is a little easier to parse than that weird output from whoami. We can probably use this.
1. I actually get the same thing as I get on my phone with bash (the whole bash [: too many arguments thing, but unlike my phone, it also displays the weird PS1 related characters.
2. Ahh, that makes me kinda happy, being a bit closer. I was testing it on a vm, just typing in some commands (actually trying whoami | wc -? something I forget now, but that wasn't even close.), but the id -u for my account gave 1000, but for su gave 0 so i thought i must be kinda close... And I stumbled upon that (id -u ) from the whoami help, I love help files.
. We can probably find a way to detect that it's adb, and to display something else for the prompt. For the time being, if it annoys you, when you go to adb shell, just run this:
. It doesn't exist on android, but if you're in a Unix/Linux setup, the man command is your friend. Anyway, I'm going to guess you ran wc -l. What that does is count the number of lines in a file. When piped to (command|wc -l) it will count the number of lines in the output passed to it. Likely, you just got 1. Anyway, I'm not sure how id reacts in normal Linux (I'll have to check that out; id -u probably does something similar to what we want), but in android it just shows all (uid and gid) with output that is a little more than we want. That being said, I threw together a quick hack to get the output we want, and it seems to work on my phone. Please try the attached file and let me know if it works.1. Okay, that's really weird. I guess adb shell doesn't like that too much. We can probably find a way to detect that it's adb, and to display something else for the prompt. For the time being, if it annoys you, when you go to adb shell, just run this:
PS1=\$
That ought to take care of it.
2. Yep, I love help files as well. It doesn't exist on android, but if you're in a Unix/Linux setup, the man command is your friend. Anyway, I'm going to guess you ran wc -l. What that does is count the number of lines in a file. When piped to (command|wc -l) it will count the number of lines in the output passed to it. Likely, you just got 1. Anyway, I'm not sure how id reacts in normal Linux (I'll have to check that out; id -u probably does something similar to what we want), but in android it just shows all (uid and gid) with output that is a little more than we want. That being said, I threw together a quick hack to get the output we want, and it seems to work on my phone. Please try the attached file and let me know if it works.
Hmm, well the PS1=\$ is doing anything for me, but should I just be running it form the adb shell prompt?
Yeah, man files have been doing almost as much of my homework help this last semester as google has lol.
Well, id -u is giving me 0 for root, but I'm testing it on some scripts, I guess that feature is just a bit too advanced for me at this point lol (thought I'd make a script to check uid and if 0 display the word root, if not display something else, some sort of insult). I'll keep following these tutorials and pdf files until I get it.
I am going to try and switch my terminal emulator back to /bin/sh and see if that clears up adb. I don't really use adb much, so it's not a big issue.
if [ `id -u` == 0 ];then
echo "root"
else
echo "some other user"
fi