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. SamDurai

    Selective file deletion

    I have many files as below present in a directory. data.20091009_0915_app.out data.20091009_0915_db.out data.20091009_0915_dbm.out data.20091009_0915_lock.out data.20091009_0930_app.out data.20091009_0930_db.out data.20091009_0930_dbm.out data.20091009_0930_lock.out...
  2. SamDurai

    Korn Arithmetic Question

    This works but may I know what is the significance of "r=0 and r at the end". Is it a temporary variable ? How is it called technically in UNIX term ? Thanks again
  3. SamDurai

    Korn Arithmetic Question

    Thanks. But when I tried it fails. Any thoughts ? /tmp > cat t.ksh var1=4.1 var2=5.9 var3=11.4 var4=15.9 result=`echo "scale=2; if ($var3+$var4) 100-(($var1+$var2)*100/($var3+$var4)) else 0" | bc` echo result=$result /tmp > t.ksh syntax error on line 1 stdin result= /tmp >
  4. SamDurai

    Korn Arithmetic Question

    Thanks for sharing valuable information. I greatly appreciate your help. I have few more questions.. 1. How to get results in two digit accurary (like 66.36 instead of just 66) 2. How to handle divide by zero. Is there any inbuilt function available for do I need to handle it? PP...
  5. SamDurai

    Korn Arithmetic Question

    May I know why "let" is preferable rather than expr or bc to handle arithmetic ?
  6. SamDurai

    Korn Arithmetic Question

    Simple arithmetic works but bit complex arthimetic fails of possible syntax error. How should I handle this in shell script /tmp > /tmp > cat t.ksh a=3 b=5 c=`expr $a \* $b` echo c=$c var1=4 var2=5 var3=11 var4=15 result=`expr 100 - (( ( $var1 + $var2 ) \* 100 ) / ( $var3 + $var4))` /tmp >...
  7. SamDurai

    More nawk formatting quesion

    I realize that thats the only option and it worked for me. Thanks again.
  8. SamDurai

    More nawk formatting quesion

    Application script named external_Pgm.ksh produces output as below when executed Current Timestamp = 2009-08-30-23.10.35.603275 No of orders = 10 Cost of new order = USD 10.00 If the same script is execute after 5 mins it produces result as below (Essentially it show the current timestamp...
  9. SamDurai

    Korn Shell / AWK Help

    Thanks for the quick response and timely help.
  10. SamDurai

    Korn Shell / AWK Help

    I have a file input.txt with the following sample data. I am trying to pattern match and assign the value to a variable. The problem is that I the assigned values are not retained outside of the nawk loop. Is there away for me to retain the variable values within the nawk loop to process later...

Part and Inventory Search

Back
Top