Register
It is currently Tue Dec 12, 2017 11:43 am

Little help for a begginer


All times are UTC - 6 hours


Post new topic Reply to topic  [ 5 posts ] 
Author Message
 PostPosted: Mon Oct 10, 2016 3:38 am   

Joined: Mon Oct 10, 2016 3:35 am
Posts: 3
Code:
#!/bin/bash

# sysinfo_page - A script to produce an HTML file

title="My System Information"

cat <<- _EOF_
    <html>
    <head>
        <title>
        $title
        </title>
    </head>

    <body>
    <h1>$title</h1>
    </body>
    </html>
_EOF_




I was wondering if anyone can tell me what is wrong with this script? As far as i understood $title should say My system information but when i run it it just says $title. If anyone could shed some light on this topic it would be great. Thanks in advance


Last edited by aleksej on Mon Oct 10, 2016 4:06 pm, edited 1 time in total.

Top
 Profile  
 PostPosted: Mon Oct 10, 2016 8:27 am   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 560
How do you invoke this script?

It just works.

But it is a very big mistake to not use code tags.
Press "full editor" if posting code and use code tags.
Otherwise it is hard to read.


Top
 Profile  
 PostPosted: Mon Oct 10, 2016 4:22 pm   

Joined: Mon Oct 10, 2016 3:35 am
Posts: 3
I was trying to run it with firefox but that didn't work out well


Top
 Profile  
 PostPosted: Mon Oct 10, 2016 5:54 pm   

Joined: Mon Oct 20, 2014 9:53 am
Posts: 560
Firefox DISPLAYS files. Usually HTML files.
It does not execute anything except some Javascript within the HTML.

Bash scripts are shellscripts.
Normaly they are executed in a console.

If you want it be displayed with FF, you need a local webserver which then runs the script using the cgi interface.
Not really advisable, but possible.


Top
 Profile  
 PostPosted: Mon Oct 10, 2016 9:28 pm   

Joined: Mon Oct 10, 2016 3:35 am
Posts: 3
I got it now, you can close the thread. Thank you :)


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP