letter.js revision 802:235d22ccfd24
159191Skris#// Usage: jjs -scripting letter.js -- <sender> <recipient>
259191Skris
359191Skris/*
459191Skris * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
559191Skris *
659191Skris * Redistribution and use in source and binary forms, with or without
759191Skris * modification, are permitted provided that the following conditions
859191Skris * are met:
959191Skris *
1059191Skris *   - Redistributions of source code must retain the above copyright
1159191Skris *     notice, this list of conditions and the following disclaimer.
1259191Skris *
1359191Skris *   - Redistributions in binary form must reproduce the above copyright
1459191Skris *     notice, this list of conditions and the following disclaimer in the
1559191Skris *     documentation and/or other materials provided with the distribution.
1659191Skris *
1759191Skris *   - Neither the name of Oracle nor the names of its
1859191Skris *     contributors may be used to endorse or promote products derived
1959191Skris *     from this software without specific prior written permission.
2059191Skris *
2159191Skris * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
2259191Skris * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
2359191Skris * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
2459191Skris * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE COPYRIGHT OWNER OR
2559191Skris * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
2659191Skris * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2759191Skris * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
2859191Skris * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
2959191Skris * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
3059191Skris * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
3159191Skris * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3259191Skris */
3359191Skris
3459191Skris/**
3559191Skris * Demonstrates "heredoc" feature with "scripting" mode.
3659191Skris *
3759191Skris * Usage: jjs -scripting letter.js -- <sender> <recipient>
3859191Skris */
39109998Smarkm
4059191Skris# This is shell-style line comment
4159191Skrisvar obj = { sender: $ARG[0], recipient: $ARG[1] };
4259191Skris
4359191Skris// JavaScript style line comment is ok too.
4459191Skrisprint(<<EOF);
4559191SkrisDear ${obj.recipient},
4659191Skris
4759191SkrisI wish you all the best.
48
49Regards,
50${obj.sender}
51EOF
52