9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I used the below script to Sum up a field in a file based on some unique values. But the problem is when it is summing up the units, it is truncating to 2 decimals and not 6 decimals as in the input file (Input file has the units with up to 6 Decimals – Sample data below, when the units in the 2... (4 Replies)
Discussion started by: brlsubbu
4 Replies
2. Shell Programming and Scripting
Hi Experts,
I have requirement to pad a decimal number that should have fixed length as 10.
if number is 234.234 > 234.234000
if number is 12.4 > 12.4000000
if number is 3456.5678 > 3456.56780
from above example we can see that overall length is 10 and padding is being done right sided of... (2 Replies)
Discussion started by: looney
2 Replies
3. Programming
Hi ,
seq can be 0...128
int windex = seq / 8;
int bindex = seq % 8;
unsigned char bitvalue = '\x01' << (7-bindex) ;
bpv.bitmapvalue = bitvalue;
This is the part of a program to convert decimal to bitmap value of hexadecimal.
I want this to change to convert only to... (1 Reply)
Discussion started by: greenworld123
1 Replies
4. UNIX for Dummies Questions & Answers
Hi,
I want to convert two hexadecimal numbers to decimal using unix command line.
1cce446295197a9d6352f9f223a9b698
fc8f99ac06e88c4faf669cf366f60d
I tried using
`echo "ibase=16; $no |bc`
printf '%x\n' "1cce446295197a9d6352f9f223a9b698"
but it doesn't work for such big number it... (4 Replies)
Discussion started by: sudhakar T
4 Replies
5. Shell Programming and Scripting
Hi All,
can you pls throw some light for below logic
-> Check the perl version
-> if the version is greater than or equal to 5.8
-> proceed to next step
-> else fail
Regards
Kamal (2 Replies)
Discussion started by: kamauv234
2 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary... (2 Replies)
Discussion started by: caramba
2 Replies
7. UNIX for Dummies Questions & Answers
Anybody please help me...
Design an algorithm that accepts an input a decimal number and converts it into BCD (Binary Coded Decimal) representation. Also, draw its Flow Chart.
This is a unix qn...
plz post algorithm for that :confused: (1 Reply)
Discussion started by: caramba
1 Replies
8. Shell Programming and Scripting
a=10
b=10.6
c=$(echo "$a - $b" | bc)
if ]
echo "success"
else
echo "failure"
fi
while executing the above sample code, am getting the below error:
seems unix is comparing .6 with 0 instead of 0.6 with 0.
can anyone help me in solving this ?
regards, (7 Replies)
Discussion started by: cmaroju
7 Replies
9. Shell Programming and Scripting
Hi,
Please find the attached scriplet and suggest me to fix the bug in this.
-----------------------------------
noofdirs=`ls *.tar | wc -l`
if ; then
let i=1
while ( $i <= $noofdirs ) ;
do
echo $i
mkdir $i
file1=`ls *.tar | head -1`
mv $file1 $i
i =... (2 Replies)
Discussion started by: sharif
2 Replies