I have never seen someone pipe 'exit' literal to command execution. This is the actual code I'm trying to understand,
echo exit | sqlplus user/pass@ora_instance @file.sql
I can understand the second half without any problem, sqlplus file execution like this does not require exit command to be issued since this is not interactive session there is no need to terminate. But even if they want to feed exit via stdin, then < exit
might be appropriate, I may not be thinking straight. Help me understand the purpose of echo exit |
I tried somethings like this to understand,
host:/home/user#>echo exit | grep e
exit
host:/home/user#>echo exit | cd $GROOVY_HOME
host:/home/user#>
This helped me understand exit here is treated as literal and not as command exit. echo exit |
seems to prevent cd $GROOVY_HOME
from getting executed but, I don't understand why!