Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by twantrd

  1. twantrd

    python3 if not equal condition in OR statement

    Ah, I completely missed that. Thank you for clearing that up!
  2. twantrd

    python3 if not equal condition in OR statement

    Hey guys, Trying to figure out why my "not equals" operator doesn't work in this OR statement: #!/usr/bin/env python3 import sys readyprompt = input("Are you ready? [y/n]\n>") ans = readyprompt.lower() if ans != "y" or ans != "yes": print("Quitting. Please run " + sys.argv[0] +...
  3. twantrd

    Perl socket backup

    Hi rvBasic, Thanks for your suggestion. I tried that and my output file is still raw data instead of a tar archive. Any other ideas? [root@twantrd tmp]# file backup.tar backup.tar: data
  4. twantrd

    Perl socket backup

    Hey guys, I'm trying to write a perl socket daemon that will listen on a port and accepts a data connection via a tar piped with netcat for backups. The client will run this command: tar cvf - tartest | nc 192.168.1.10 9999 my perl code is here: #!/usr/bin/perl -w use strict; use...
  5. twantrd

    Simple digit length

    doh! Thanks for the answer guys! -twantrd
  6. twantrd

    Simple digit length

    Sorry, pasted the wrong one. This is the correct one: #!/usr/bin/perl use strict; use warnings; use diagnostics; my $rounded=58.333333; #$rounded =~ /\d{1,2}\.\d{2}/; #$rounded =~ /^\d\d\.\d\d$/; my $value = $rounded =~ /^\d\d\.\d\d$/; print "The rounded percentage is: $value" . "%\n"...
  7. twantrd

    Simple digit length

    Hey all, I've been reading how to restrict digits to a certain length and I don't see the error. #!/usr/bin/perl use strict; use warnings; use diagnostics; my $rounded=58.333333; #$rounded =~ /^\d\d\.\d\d$/; # one solution $rounded =~ /^\d{2}\.\d{2}/; # another solution print "Rounded...
  8. twantrd

    Check for empty array

    Ok, I think I found the problem. The script works fine on a linux server but not on this storage device. Perl is messed up somehow on this unit. Thanks for the help everyone! -twantrd
  9. twantrd

    Check for empty array

    thanks for the input, but same result. Weird isn't it? -twantrd
  10. twantrd

    Check for empty array

    Sorry, yes, this is a question. I'm wondering why my statement doesn't print anything when all drives are healthy. If everything is healthy, it should print "OK". Kirsle, I tried your if statement and the results are the same. The contents of the file, /tmp/drive_stats looks like this: Bay...
  11. twantrd

    Check for empty array

    Hi, I'm writing a simple check for a jbod device. If all the drives come back with a status sign of "HEALTHY" then I print an "OK" statement. If it doesn't come with that status, then I print "CRITICAL". Very simple. My script prints CRITICAL when the condition is met but it doesn't print...
  12. twantrd

    text area form post, to new form on perl page

    Here is the html page: <html> <head> <title>Blah</title> <body> <h1>::.Form.::</h1> Input a string: <form name="form" method="post" action="/cgi-bin/perlform.cgi"> <input type="text" size="30" maxlength="30" name="text"> <p> <input type="submit" name="submitbutton" value="Submit"> </form>...
  13. twantrd

    Print matching items via sendmail

    Kevin, Thank you so much! That was it. It works now. The missing piece was: $match .= $_; Again, I appreciate your help. Thank you! -twantrd
  14. twantrd

    Print matching items via sendmail

    Thanks for spotting that out, Kevin. But, how do I save it so that it prints out ALL matching strings? I tried putting that in an array and it still emails me with nothing in the body. Thank you for your help. -twantrd
  15. twantrd

    Print matching items via sendmail

    Hi there, I'm trying to match a list of items and using sendmail to mail me only those matching strings from a file. This is the code I have so far: use FileHandle; my $match; # Grab the filenames that have been downloaded open (FILENAME, "<$logfile"); while (my $match=<FILENAME>) {...

Part and Inventory Search

Back
Top