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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. hg4372

    Calculate.pl Not working correctly. Please help - Newbie

    Thanks for the quick response. Sorry I didn't use
  2. hg4372

    Calculate.pl Not working correctly. Please help - Newbie

    I have a script that allows the user to input the following: EQUALS CLEAR PLUS MINUS OVER TIMES But I run the script then type PLUS 42, it actually makes the value 43. Please help #!/usr/bin/perl use strict; use warnings; my $value; print "\n> "; while ( <> ) { chomp; if (...
  3. hg4372

    Help with using SSH in KSH Script.

    Thanks for the direction everyone. I now have expect loaded on my server, and will try to figure it out. Is there a way to use my existing script above, and only call the expect for the actual ssh part, or would it be better to write the entire thing with expect ? Sorry for the stupid...
  4. hg4372

    Help with using SSH in KSH Script.

    Currently I'm using the script below only with TELNET instead of SSH and it works great. Trying to do the same type of thing with SSH, and can't seem to get it to login. Please Help and newby out. #!/usr/bin/ksh # echo "Enter switch: \c" # read switch # echo "Enter username: \c" # read...
  5. hg4372

    awk file in if statement then statement KSH

    I figured out the issue. Apparently the file I wanted to be included in the email can't have () or : in it. Once I removed those the script works fine.
  6. hg4372

    awk file in if statement then statement KSH

    I have a get_script that kicks off the other script. The reason is I'm pulling the same data from several places at once ever 5 minutes. CRON Entry 1,6,11,16,21,26,31,36,41,46,51,56 * * * * /export/home/scripts/get_mtxcper cat get_mtxcper /export/home/scripts/mtxcper STLOMTX & cat mtxcper...
  7. hg4372

    awk file in if statement then statement KSH

    /usr/lib/sendmail -v -f "ALERT" email@address.com < ALERT.txt I only get 1 email when I do this, however I only see ALERT in the sender information. No information from the ALERT.txt file is included. I was including the if statement at the end of a cron that runs every five minutes...
  8. hg4372

    awk file in if statement then statement KSH

    percent='99' percent is small before send email@address.com... Connecting to corpmta.com. via relay... 220 wimidd01-smtp-01-internal.com ESMTP >>> EHLO ilscha01-nsweng-01.com 250-wimidd01-smtp-01-internal.com 250-8BITMIME 250 SIZE 16777216 >>> MAIL From:<ALERT@ilscha01-nsweng-01.com> SIZE=36 250...
  9. hg4372

    awk file in if statement then statement KSH

    Still get about 9 emails with only a subject.
  10. hg4372

    awk file in if statement then statement KSH

    It seems to be working as far as the if portion, however it this is in a KSH script. When it meets the criteria of the if statement I get several emails in a row with nothing in them other then ALERT as the subject. if (( $(< PERCENT_ALERT.txt ) <= 100 )); then /usr/lib/sendmail -v -f "ALERT"...
  11. hg4372

    awk file in if statement then statement KSH

    Better explanation is if the value in the PERCENT_ALERT.txt file is less than or equal to 100 then send an email with the text of a different file. Hope that makes sense.
  12. hg4372

    awk file in if statement then statement KSH

    Thanks for the help. The PERCENT_ALERT.txt is a single line file that only has a numeric value as such. 98
  13. hg4372

    awk file in if statement then statement KSH

    if [[ awk '{ print $1 =< 100 }' PERCENT_ALERT.txt ]] ; then /usr/lib/sendmail -v -f "ALERT" "email@address.com" < ALERT.txt else echo "File is Empty" #echo "File is Empty" | mailx -s "FILE_EMPTY" herb.glaser@uscellular.com fi;
  14. hg4372

    Newby index function help

    Thank you. That worked good. What if one of the items was "escargo" ? I would only want the items that end with "es" not anything with es in it. Is there a way to do that ? Here is what I got when I replaced Durian with escargo. Total value of White Peaches on hand = $285 Total value of...
  15. hg4372

    Newby index function help

    I'm currently trying to learn PERL, and my instructor tasked me with the following and I'm kind of lost. #!/usr/bin/perl use strict; use warnings; # Grocery store inventory: my $lines = <<'END_OF_REPORT'; 0.95 300 White Peaches 1.45 120 California Avacados 5.50 10 Durian 0.40 700...
  16. hg4372

    KSH script not outputting a readable file.

    Sorry it took so long for me to get back. The awk worked great. Thanks for your help with this.
  17. hg4372

    KSH script not outputting a readable file.

    I have the following: /usr/bin/tail /usr/xpg4/bin/tail /usr/ucb/tail Trying to make it work interactively , however the goal will be Cron. For some reason it is putting all the text in the new file all together. Example First file. BOB GEORGE JEFF GREG BILLY Second file after tail...
  18. hg4372

    KSH script not outputting a readable file.

    I have a KSH script that is working great on Solaris 10 Sparc, however I FTP this script to a different machine running Solaris 9, and now the #.LIVE.txt output is garbage when viewing from Web Browser. The original file shows fine, so it seems to be an issue with my Tail +15. I'm so confused...
  19. hg4372

    Help with ps -ef | grep defunct in KSH script

    Actually it works, however I noticed that there is garbage on the first line of the output. It doesn't show up when I cat the file, but when I link to the file from a webpage it shows up as garbage. Any suggestions as to why ?
  20. hg4372

    Help with ps -ef | grep defunct in KSH script

    Thanks that worked.

Part and Inventory Search

Back
Top