I want a Bash script that generates a HTML template. The template will include libraries based on the input arguments at the command line. Here is my idea:
#!/bin/bash
function libraries
{
if [ "$1" == "bootstrap" ]; then
echo "<link type="text/css" rel="stylesheet" href="css/bootstrap.css" />"
fi
}
##### Main
cat << _EOF_
<!DOCTYPE html>
<html>
<head>
<title> </title>
$(libraries)
</head>
<body>
</body>
</html>
_EOF_
When I run ./template_creator.sh bootstrap I get this output:
<!DOCTYPE html>
<html>
<head>
<title> </title>
</head>
<body>
</body>
</html>
If I don't include the if statement and just echo, it outputs fine. So I am thinking the trouble is in the if statement. Any suggestions?