The difference from yours is "sudo " part of the command. "sudo " prefix is unnecessary when you have already typed "sudo gainroot" on one of the previous lines.