What is <
Consider:
#!/bin/bash
/u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh <<!END
connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();
!END
The above script is there to help me to perform a redeploy for weblogic application. The area I don't understand is wlst.sh <<!END as well as the last !END.
What's the function of both !END statements?
0 1 Answer
It's a Here Document -- the lines between <<!END and !END are fed to the stdin of wlst.sh
It could also be expressed as:
echo "connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();" | /u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh
but without the potential effects of running the command in a subshell.
It could also also be expressed as:
echo "connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();" > someFile
/u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh < someFile
rm someFile
7
Consider:
#!/bin/bash
/u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh <<!END
connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();
!ENDThe above script is there to help me to perform a redeploy for weblogic application. The area I don't understand is wlst.sh <<!END as well as the last !END.
What's the function of both !END statements?
1 Answer
It's a Here Document -- the lines between <<!END and !END are fed to the stdin of wlst.sh
It could also be expressed as:
echo "connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();" | /u01/app/oracle/middleware/oracle_common/common/bin/wlst.shbut without the potential effects of running the command in a subshell.
It could also also be expressed as:
echo "connect('user','pw');
p=redeploy('application');
p.printStatus();
exit();" > someFile
/u01/app/oracle/middleware/oracle_common/common/bin/wlst.sh < someFile
rm someFile 7