Find the answer to your Linux question:
Results 1 to 2 of 2
Hello, I am trying to get the following script working: ===cut=== #!/bin/sh # Gets System uptime. $1 is host name upt='</proc/uptime' for line in $upt dummy $1 do echo "$line" ...
  1. #1
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    103

    [SOLVED] Scripting Question...

    Hello,

    I am trying to get the following script working:
    ===cut===
    #!/bin/sh
    # Gets System uptime. $1 is host name
    upt='</proc/uptime'

    for line in $upt dummy $1
    do
    echo "$line"
    done

    ===cut===

    I get this output after making it exec and running it:
    ===cut===
    strangelove:/home/dcole# chmod a+x up2mrtg
    strangelove:/home/dcole# ./up2mrtg strangelove
    </proc/uptime
    dummy
    strangelove
    strangelove:/home/dcole#
    ===cut===
    Any ideas why it is not showing uptime?

    Also "more" shows the uptime etc... What am I doing wrong here?

    Thanks,
    Dave

  2. #2
    Linux Newbie
    Join Date
    Dec 2009
    Posts
    103
    Solved it myself... Wrong quotes...
    Dave

Posting Permissions

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