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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Chloe Bennett

Chloe Bennett

Culture, Media & Entertainment Columnist

Chloe Bennett explores the intersection of pop culture, streaming entertainment, digital trends, and contemporary lifestyle. Her weekly commentary reaches thousands of culture enthusiasts.

Share this article
Twitter Facebook Pinterest