Problem with adding in HP-UX


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Problem with adding in HP-UX
# 1  
Old 01-19-2006
Problem with exponentials while adding in HP-UX

Hi,
Facing some issues while adding due to exponentials in HP-UX 11.00 ora@ps:/var/tmp> cat dbrec.log
MAX(SEQUEN
----------
1000299
1 row selected.

ora@ps:/var/tmp> NEXT_NUM=`awk '/^ /{print $1 + 1}' dbrec.log`
ora@ps:/var/tmp> export NEXT_NUM
ora@ps:/var/tmp> echo $NEXT_NUM
1.0003e+06

How can I avoid this ?

Thanks
Vinit

Last edited by win_vin; 01-19-2006 at 08:55 AM..
# 2  
Old 01-19-2006
Use printf to format the output
Code:
NEXT_NUM=`awk '/^ /{printf("%8d\n", $1 + 1)}' dbrec.log`

 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Problem with adding date

Hi All, Please let me know the error in the below code. m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) M=$(date +%m) Y=$(date +%Y) if ; then M=01 Y=$(($Y+1)) else M=$M+1)printf "01-%s-%d\n" ${m} $Y fi Log: + m=(0 Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec) ++... (4 Replies)
Discussion started by: kiranparsha
4 Replies

2. UNIX for Advanced & Expert Users

adding new user problem?

I wan to add a new user. I have executed the following command. The user home directory is created. but password creation shows error. Note: I'm using LDAP Server for user authentication. adduser xxx Adding user `xxx' ... Adding new group `xxx' (1003) ... Adding new user `xxx' (1003) with... (2 Replies)
Discussion started by: ungalnanban
2 Replies

3. Red Hat

Spacewalk. Problem with adding the channel

OS: Fedora Linux 11 Spacewalk: 0.6 Installed by manual: https://fedorahosted.org/spacewalk/wiki/HowToInstall I download special script (create_channel.py) for registarion client from CLI and added 3 channel with 32-Bit architecture and all OK: Fedora 11 32-Bit RHEL 4.7 32-bit RHEL 5.3... (2 Replies)
Discussion started by: jess_t03
2 Replies

4. Red Hat

Spacewalk. Problem with adding SunOS system

Hello i tryed add SunOS system to Spacewalk and see this error: # cat /etc/release Solaris 10 10/08 s10s_u6wos_07b SPARC Copyright 2008 Sun Microsystems, Inc. All Rights Reserved. Use is subject to license terms. ... (1 Reply)
Discussion started by: jess_t03
1 Replies

5. Shell Programming and Scripting

problem while adding column values in awk

Hi, I have a file "input.txt" with the following content : 5312,0,,,1,8,141.2,20090727 3714,0,,,1,8,285.87,20090727 5426,0,,,1,8,3.9,20090727 3871,0,,,1,8,30.4,20090727 9071,0,,,1,8,146.2,20090727 5141,0,,,1,8,2.8,20090727 0460,0,,,1,8,-0.1,20090727 7918,0,,,1,8,-0.1,20090727... (3 Replies)
Discussion started by: valokv
3 Replies

6. Shell Programming and Scripting

Problem adding into an array field!!!

Hi, Kindly assist by analyzing the code below and suggest changes to achieve the required output. The input file: 01-010241800000 35000 MV010 02/03/09 0306 03060226 03 02-004103300000 470000 MV010 02/03/09 0301 03010276 03 The objective is to convert field No4. from dd/mm/yy to yyyymmdd... (5 Replies)
Discussion started by: talk2pawee
5 Replies

7. AIX

problem adding NIM client

Hello All, While trying to add NIM client to the NIM environment from NIM client machine, I get the following error: 1800-109 There are currently no additional SMIT screen entries available for this item. This may require installation of additional software before it can be accessed. ... (1 Reply)
Discussion started by: solaix14
1 Replies

8. Solaris

problem after adding new ide disk

Hi experts, i have added a new disk to my ultra 10 system, after that i am unable to boot the system, its not booting from disk neither from cd. please help! Regards (16 Replies)
Discussion started by: kumarmani
16 Replies

9. Shell Programming and Scripting

problem with displaying date and adding time

Hi, I have a log file with contents like 81.49.74.131 - - 81.49.74.131 - - 116.112.52.31 - - 116.112.52.31 - - I need an output like this 81.49.74.131 14/Sep/2008 Time duration: 00:06:00 116.112.52.31 15/Sep/2008 Time duration: 00:00:01 Please anyone suggest a script for this.... (1 Reply)
Discussion started by: FuncMx
1 Replies
Login or Register to Ask a Question