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 TouchToneTommy 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: *

  • Users: hg4372
  • Content: Threads
  • Order by date
  1. 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 (...
  2. 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...
  3. 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;
  4. 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...
  5. 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...
  6. hg4372

    Help with ps -ef | grep defunct in KSH script

    Here is my script. However it doesn't seem to capture any data. I tried the same script without the grep and it still doesn't seem to capture anything. I assume it doesn't like the - and the |. Please help. #!/usr/bin/ksh # echo "Enter switch: \c" # read switch # echo "Enter username: \c" #...
  7. hg4372

    DIFF Help

    I'm trying to do a diff on two files which works, however some of the strings our out of sync in the output file. Any ideas ? FILE 1 231 0 1 1 9144 11 113434 545 193 231 0 2 2 1377 0 1392 16 6 231 0 7 1 51 0 338 290 142 231 0 7 2 1433 0 1469 32 12 FILE 2 231 0 1 1 9145 11 113435 545 193 231 0...
  8. hg4372

    Parsing fields from multiple lines ?

    I have logs being captured to a file. The log format is the same for all of them. In the below example the ALL_SAME,B,C,D, and E are the fields I want to parse, however the fields B,C,D, and E are not always the same. Could someone please point me in the right direction on what would be the...
  9. hg4372

    Newbie to KSH Please help

    #!/usr/bin/ksh # echo "Enter market: \c" # read market # echo "Enter username: \c" # read username # echo "Enter password: \c" # read password market=$1 dt=$(date +%m%d%y) username=test password=test for x in 1 do { echo $username sleep 5 echo $password sleep...
  10. hg4372

    Grep or Awk or Sed ? Please Help

    I'm fairly new to unix so please bear with me. I have several log files that I need to extract certain lines from and output to another file. I apologize for the crude example: Bob Jim Joe Ralph Steve George I only want to extract Lines 3 through 5 and pipe to a file. Could someone please...
  11. hg4372

    Help with Grep multiple files in reverse order.

    I'm running the following on multiple files in a directory, and. It works fine, however I would like the most recent file be at the top and the oldest at the bottom. Is this possible ? grep "Test" /export/home/test/market1* > /export/home/test_history/market1.HIS.txt...
  12. hg4372

    Rename Multiple Files

    I have hundreds of files that I need to rename or remove the : from. Any help would be appreciated. Carsandtrucks.LOG_111709_14:41 Want all the files to look like this: Carsandtrucks.LOG_111709_1441 Just need to remove the :
  13. hg4372

    Script to Cat specific file based on Date in File name

    Please Help. I'm trying to write a script on Machine A that logs into Machine B that is rotating log files every half hour. So what I want to do is pull the latest file based on the date. cd /temp file_20091027130000 file_20091027133000 file_20091027140000 file_20091027143000 So at 13:15 I...

Part and Inventory Search

Back
Top