10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I have a below snippet of code from my perl script and its causing a problem when the output of $lTAX is 0 (zero) its getting displayed as -0.00. I want output to be 0 not -0.00. Any help would be appreciated.
#!/usr/bin/perl
my $lTotA = 50.94;
my $lVatA = 8.49;
my $lAllocD;
my $lAdjNr =... (4 Replies)
Discussion started by: Devesh5683
4 Replies
2. Shell Programming and Scripting
#!/bin/sh
CURRENTSTATE=2
CSVCSTATE=2
LASTSTATECHANGE=8
CSVCSTATEAGE=5
if (($CURRENTSTATE==$CSVCSTATE))&&(($LASTSTATECHANGE>=$CSVCSTATEAGE))
echo GREAT
fi
returns:
./aff: line 12: syntax error near unexpected token `fi'
./aff: line 12: `fi'
what am i doing wrong here? (6 Replies)
Discussion started by: SkySmart
6 Replies
3. Shell Programming and Scripting
$total=500
echo "scale=2; $val1*100/$total" | bc
echo "scale=2; $val2*100*100/$total" | bc
echo "scale=2; $val3*100/$total" | bc
I want to make the above code to be accomplish in a single echo line.
For instance output:21.3, 44.2, 51.6
How to achieve that, some one please help, i just... (5 Replies)
Discussion started by: alvin0618
5 Replies
4. Shell Programming and Scripting
Hi Gurus,
I am working with a korn shell script to simplify some operations of calculation number of lines inside compressed file.
The called function (inside a cycle) is the following:
#########################################
# F.ne: CheckCount
#########################################... (3 Replies)
Discussion started by: GERMANICO
3 Replies
5. Shell Programming and Scripting
I've gone through bunch of threads on time calculations but none of them helps on my problem
I've to get the time difference in HHMM format from following inputs
Input 1 :
01/08/2010 01:30
01/08/2010 03:20
Input 2 :
01/06/2010 22:00
01/07/2010 16:00
First input is easy but... (8 Replies)
Discussion started by: prash184u
8 Replies
6. Shell Programming and Scripting
Hello all,
Please help with the below.
I have a requirement where in I have to read a pattern and print it as shown below.
Patterns will be as below.
Input Output
Pattern Should be printed as below with spaces such that I can awk.
-*--* - * - - *
*--**... (2 Replies)
Discussion started by: tenderfoot
2 Replies
7. Shell Programming and Scripting
I have a list of coordinate data, sampled below.
54555209 784672723
I want it as:
545552.09 7846727.23
Below is my script:
BEGIN {FS= " "; OFS= ","} {print $1*.01,$2*.01}
This is my outcome:
5.5e7 7.8e8
How do I tell awk that I want to keep all the digits instead of outputting... (1 Reply)
Discussion started by: ndnkyd
1 Replies
8. Shell Programming and Scripting
Hi All,
can some body help me to script the below logic. Basically am facing
problem with float calculation. Also i need this to be done inside a single awk.
I tried lot of tuning but still nothing is getting displayed, nor any errors
param=50
value=19.23
for(i=0;i<4;i++)
{... (2 Replies)
Discussion started by: jisha
2 Replies
9. Shell Programming and Scripting
Hi,
I have given the following statement in a script to put the values of variables (VAR1, VAR2,...) in a file.
echo " $VAR1 $VAR2 $VAR3 $VAR4 $VAR5" >> filename
But the output is not coming properly. Variables VAR5, VAR4 are replacing the first (VAR1, VAR2,..). I can't... (5 Replies)
Discussion started by: abrd600
5 Replies
10. UNIX for Dummies Questions & Answers
Have the following lines in a script: echo "-----------------------------------------------"\
"---------------------" >> $xdfrpt
echo "- Date - - / - /stand - /u - /u1 - /u2 -"\
"/x1 - /x2 - /x3 -" >> $xdfrpt
echo... (1 Reply)
Discussion started by: Cameron
1 Replies