0

Hey guys i'm learning how to code shell scripts and tried to do a simple html page. My script looks like this:

#!/bin/bash

# sysinfo_page - A script to produce an html file

cat <<- _EOF_
<html>
    <head>
        <title>
        The title of your page
        </title>
    </head>

    <body>
        Your page content goes here.
    </body>
</html>
_EOF_

And it's saved in my $HOME/bin, but doesn't quite work. Path is okay because i have other simple script working from there (Hello World). This one creates the html file but empty, and i don't know why. When i use command:

sysinfo_page > sysinfo_page.html

First it tells me i have no permission so i have to use sudo for this, and then tells me

sudo: sysinfo_page: command not found

But the sysinfo_page.html is created empty anyway.

Animu
  • 11
  • > sysinfo_page.html creates the file regardless of whether it is preceded by anything which produces output. – user4556274 Aug 07 '16 at 11:26
  • 1
    Does your script have execute permission? Show ls -l sysinfo_page – user4556274 Aug 07 '16 at 11:28
  • It sure does now. Thanks for advice, i thought it is executable from creation since my earlier script was, i'll keep in mind to check it from now on :) – Animu Aug 07 '16 at 11:32

0 Answers0