EvZ
EvZ

Reputation: 12169

adb hell command (not a typo)

I have a question about ADB, does anyone know what is the difference between:
adb shell & adb hell commands?

I'm wondering if except the "hellish" terminal color(only on Linux, in Windows you just get some prefixes) there are any other differences?
Seriously check yourself.

enter image description here

Upvotes: 25

Views: 4647

Answers (2)

laalto
laalto

Reputation: 152787

Reading the source:

if(!strcmp(argv[0], "shell") || !strcmp(argv[0], "hell")) {
    int r;
    int fd;

    char h = (argv[0][0] == 'h');

    if (h) {
        printf("\x1b[41;33m");
        fflush(stdout);
    }

    if(argc < 2) {
        D("starting interactive shell\n");
        r = interactive_shell();
        if (h) {
            printf("\x1b[0m");
            fflush(stdout);
        }

...

            if (h) {
                printf("\x1b[0m");
                fflush(stdout);
            }

This code confirms that if the shell or hell command starts with an h, extra control sequences for changing terminal colors are output but nothing else.

Upvotes: 27

pshegger
pshegger

Reputation: 2596

As far as i know there is no other difference between the two.

Upvotes: 1

Related Questions