If you do .logoff alone, the current session alone will end(i.e you will only be logged off from your userid only), but teradata engine is still open and all the forth coming commands will go into the teradata engine. As you have logged off, and still inside the teradata engine, unix cmd3 is trying to get executed in teradata itself and since you have logged off, it is asking you to login again.
For your unix command to run, the code should return to unix shell. So for this use .QUIT instead of .LOGOFF as .QUIT will automatically automatically logoff your current session and teminate from teradata engine returning to unix shell. All the unix commands following .QUIT will now be executed in unix shell.
If you want to use unix commands inside your bteq,i.e
bteq <<[Test]
SEL * FROM schemaname.tablename;
[Test]
If you want to use a unix command say remove a file, inside a bteq, use
.os rm filename
E.g:
bteq <<[Test]
SEL * FROM schemaname.tablename;
.os rm filename
[Test]
Note: Not all unix commands will work inside bteq even if prefixed with .os
If you do .logoff alone, the current session alone will end(i.e you will only be logged off from your userid only), but teradata engine is still open and all the forth coming commands will go into the teradata engine. As you have logged off, and still inside the teradata engine, unix cmd3 is trying to get executed in teradata itself and since you have logged off, it is asking you to login again.
For your unix command to run, the code should return to unix shell. So for this use .QUIT instead of .LOGOFF as .QUIT will automatically automatically logoff your current session and teminate from teradata engine returning to unix shell. All the unix commands following .QUIT will now be executed in unix shell.
If you want to use unix commands inside your bteq,i.e
bteq <<[Test]
SEL * FROM schemaname.tablename;
[Test]
If you want to use a unix command say remove a file, inside a bteq, use
.os rm filename
E.g:
bteq <<[Test]
SEL * FROM schemaname.tablename;
.os rm filename
[Test]
Note: Not all unix commands will work inside bteq even if prefixed with .os