10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello ,
This is the piece of the code which is giving me trouble
if ;then
exit_proc "${SOURCEDIR}/${OUT_FILE} does not exists or not readable" 2
else
word_count=`wc -l < ${SOURCEDIR}/$OUT_FILE`
fi
if ;then
exit_proc "Word_count is more than allowed limit" 1
else... (6 Replies)
Discussion started by: Sri3001
6 Replies
2. Shell Programming and Scripting
Hi,
I have placed the script and running successfully on AIX
However in Linux it throws integer expression expected
Could some one please help me to fix this
MaxThreshold4alert=`echo "$MaxCapacitycnt*(80/100)" |bc -l`
echo $MaxThreshold4alert
Error:
40.00000000000000000000: integer... (2 Replies)
Discussion started by: ajothi
2 Replies
3. Shell Programming and Scripting
Newb here
echo "$yesterdaysclose"
echo "$close"
if ; then
echo "stocks moving up"
elif ; then
echo "stock is moving down"
else
echo "no change"
fi
seems to evaluate the floating decimal correctly however returns
./shellscript1.sh: line 17: [: : integer expression expected... (3 Replies)
Discussion started by: harte
3 Replies
4. Shell Programming and Scripting
hi,
how to I do this?
i="4.000"
if ; then
echo "smaller"
fi
how do I convert the "4.000" to 4?
Thanks! (4 Replies)
Discussion started by: h0ujun
4 Replies
5. UNIX for Dummies Questions & Answers
Ok, so I am beggining a script to factor the time difference from when a user logs on to current time but before I can even get too far I am getting the INTEGER EXPRESSION EXPECTED error. Can someone tell me what I am doing wrong?
lhour=$(who | grep "$1" | cut -c30,31);
lmin=$(who | grep "$1"... (1 Reply)
Discussion started by: losingit
1 Replies
6. Shell Programming and Scripting
Hi,
echo $i
until ||
do
read NUM
if && ; then
printf "$FBOLD\nInvalid number, please enter valid backup number: $FREG"
fi
done
Getting below error :
./import_location.sh: line 234: [: : integer expression expected
./import_location.sh: line 234: [: :... (5 Replies)
Discussion started by: milink
5 Replies
7. Shell Programming and Scripting
Hi !
I'm looking for a way to transform certain floating point numbers in a one-line, variable length file to integers.
I can do this in a crude way with sed :
sed -e 's/0\.\(\):/\1:/g' -e 's/0\.0\(\):/\1:/g' -e 's/1\.000:/100:/g' myfile ... but this doesn't handle the rounding correctly.
... (3 Replies)
Discussion started by: jossojjos
3 Replies
8. UNIX for Dummies Questions & Answers
Hiii
I actually intent to check the integer or floating point number input by user i.e. 23, 100, 55.25, 12.50 ..etc. However, when someone input strings or alpha character, my program has to show invalid input.!! Is there any Unix shell script syntax can help me to check ?
Thanking you (2 Replies)
Discussion started by: krishnampkkm
2 Replies
9. Shell Programming and Scripting
Hi All,
I got this script that pulls the Amps value from our RPC's , I basiclly want to compare the valued with a "limit" value -- if the numbers match or are greater than the definded value ...do something. My problem is I cant seem to figure out how to compare floating points...
here is... (1 Reply)
Discussion started by: zeekblack
1 Replies
10. Shell Programming and Scripting
Hi,
I am trying to write a script to extract multiple sets of data from a chemistry output file. The problem section is in the following format...
Geometry "geometry" -> "geometry"
1 Pd 46.0000 -0.19290971 0.00535260 0.02297606
2 P ... (7 Replies)
Discussion started by: smadonald1
7 Replies