If you teminate all your commands with some character such as \r or \n, then you can loop on the uartGetByte and save the bytes in an array of characters until you receive the end character. Then use the character array as a string to see the result.
char result[255];
uint8_t getLine() {
char temp;
uint8_t len=0;
while(1) {
temp=uart2GetByte(); // Returns -1 if nothing read
if (temp=='\r') {
result[len]='\0'; // Null terminate string
return len; // Return the length of the string
} else if (temp != -1) {
result[len++]=temp;
}
}
}