Add two numbers like 0001+1 and get result as 0002


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Add two numbers like 0001+1 and get result as 0002
# 1  
Old 06-05-2006
Add two numbers like 0001+1 and get result as 0002

Hi all,

I have to add a number like 0001+1=0002.
If i put expr 0001 + 1 it is giving result as 2 but i wanted to get 0002.
Please tell me how can i get this.

Thanks,
Sona.
# 2  
Old 06-05-2006
check this

See this link. It will guide you.
typset command
# 3  
Old 06-05-2006
Hiiiiiii,

Thanks a lot.It is working fine now.

Sona.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to compare the current result with previous line result.?

Hi Gurus, I have requirement to compare current result with previous reuslt. The sample case is below. 1 job1 1 1 job2 2 1 job3 3 2 job_a1 1 2 job_a2 2 2 job_a3 3 3 job_b1 1 3 job_b2 2 for above sample file, GID is group ID, for input line, the job run... (1 Reply)
Discussion started by: ken6503
1 Replies

2. Shell Programming and Scripting

Counting specific column and add result in output

Hi all, I have a quick question: I have a 4 column tab-separated file. I want to count the number of times each unique value in column 2 appears and add that number in a 5th column. I have the following input file: waterline-n below-sheath-v 14.8097 A dock-n below-sheath-v ... (4 Replies)
Discussion started by: owwow14
4 Replies

3. Shell Programming and Scripting

How to add values of two files and result in third file

Hi, I am new to shellscripting, I have two files as below File1: Abcdefg110111xyza000000600000000024.020000060000000000024.020000004660000000003.41000000000010000000100.000000000123 File 2:... (3 Replies)
Discussion started by: rajendrabujji
3 Replies

4. Shell Programming and Scripting

Renaming files from aaaa-zzzz to 0001-9999

Hi, I am using split in AIX to split a large file into parts, but in AIX, it names the resulting files something like newaaaa, newaaab, newaaac etc (using a-z for each) I need to rename these new0001, new0002, new0003 etc. Is there an easy way to do this? Cheers, Rob (4 Replies)
Discussion started by: say170
4 Replies

5. Shell Programming and Scripting

Add numbers in a file

Hello, How to add numbers that are read from a file /tmp/test The content of the file look like 1234 234 432 1235 123 I read the file content in a for loop f=/tmp/test for i in `cat $f` do . . done Santhosh (11 Replies)
Discussion started by: mvsanthosh
11 Replies

6. Shell Programming and Scripting

Using Awk to Add Numbers

echo "0.1 2.0 0.4 2.0 4.3 1.0 6.0 9.0" | awk 'BEGIN {total=0} {total += $1} END {print total}' I want to add the above output from the echo command, but i can't figure this out. The output above always spits out inaccurate numbers. can someone please provide me with a one liner similar to... (4 Replies)
Discussion started by: SkySmart
4 Replies

7. UNIX for Dummies Questions & Answers

how can i add two numbers

hi, i am having one file which looks like the one below: ABC1 *** 1 4 ABC2 *** 7 12 ABC3 *** 0 34 ... (4 Replies)
Discussion started by: kripssmart
4 Replies

8. Shell Programming and Scripting

How to add numbers

Hello. I new to Shell Scripting. I have a file and here is the output of the file. 1.1M 1.1M 3.3M 149K 61K 75K 144K 135K 82K 170K 327K 2.0M 219K 165K (8 Replies)
Discussion started by: email-lalit
8 Replies

9. Shell Programming and Scripting

How to add numbers?

:confused: I have plain text file "tmp" which include a range of numbers(bytes), say like: 123 234 567 2434 2323 213123 How can I add them and display out. should I use AWK, then how? I am a newer in Bourne shell, please give me a hand, thanks a lot (7 Replies)
Discussion started by: pnxi
7 Replies

10. Shell Programming and Scripting

Add some numbers!

im using this command to return the number of links in my directory, grep -c -i -h "href" *html */*html *htm *shtml is there a way of adding these to get the total? Cheers (3 Replies)
Discussion started by: TalkShowHost
3 Replies
Login or Register to Ask a Question