+ Reply to Thread
Results 1 to 3 of 3

Thread: Bash shell script

  1. #1
    Full Member whiteknight is on a distinguished road
    Join Date
    Jan 2004
    Location
    Philadelphia
    Posts
    42

    Bash shell script

    Okay, i'm trying to write a simple, dirty shell CGI script that will act as a simple hitcounter.

    I know very little shell script, and am wondering how i would go about doing this.

    dont ask why, i have no motives.
    thats right, I am the webmaster.

  2. #2
    Newbie ggx is on a distinguished road
    Join Date
    Jan 2004
    Posts
    3

    I assume something like this works (but I haven't tested it)

    #!/bin/sh

    echo "Content-type: text/html\n\n";
    echo "<html><body>Hi guys what's up?</body></html>";

    you could place the count # in a file, and assign it to a variable and increment it, e.g.:

    count = `cat filename`
    let "count += 1"
    echo "Visitor number $count"
    echo "$count" > filename


    the above code should read the number of visits from filename, increment it, print it, and save it to the file again.


    -GG

  3. #3
    Full Member whiteknight is on a distinguished road
    Join Date
    Jan 2004
    Location
    Philadelphia
    Posts
    42
    yeah, thanks man. I really want to learn more of this stuff so i can get better on linux machines, but it is so hard to find references or tutorials for it online.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts