adding 0 to a variable


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting adding 0 to a variable
Prev   Next
# 1  
Old 02-14-2007
adding 0 to a variable

Can anybody plz help me to solve this puzzle?

amt=00002280674231
((amt = amt + 0)) # to remove leading zero's

echo $amt

prints -2014293065

but this works fine for numbers less than 2000000000.

Thanks
S
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Adding variable number of space in between two string

Hi, I am looking for the way to add variable number of spaces between two string. e.g input line is a ,bb abc ,bcb pqr ,bfg My output should be something like this a ,bb abc ,bcb pqr ,bfg This text... (9 Replies)
Discussion started by: diehard
9 Replies

2. Shell Programming and Scripting

Adding more text to a variable

Is there a more simple way to add text to a variable I havevar="blue" and like to add green to getecho $var blue green Here is how I do it. var=$(echo "${var} green") ---------- Post updated at 13:23 ---------- Previous update was at 13:12 ---------- :o Uff Not always easy to see the... (2 Replies)
Discussion started by: Jotne
2 Replies

3. Shell Programming and Scripting

Adding Content to Variable (bash)

is this possible? its kind of like incrementing the value of a number in a variable. but in this case, instead of the value of the variable being a number, it's just contents/strings/characters/alpha-numeric etc. NOT a number. For instance: VAR=Tommy for all in $(blah blah) do ... (2 Replies)
Discussion started by: SkySmart
2 Replies

4. Shell Programming and Scripting

Adding grep'd results in a variable

Here is one I am baffled with; I have not used unix for a while and now that I am back it has been fun remembering and I have enjoyed it, for the most past. this is in ksh. I need to search in a file for the line with X1 and cut columns 20-25, put them into a variable, added them (dollar... (3 Replies)
Discussion started by: CougarMutt
3 Replies

5. UNIX for Dummies Questions & Answers

Adding Two Decimals Together and Storing as a Variable

Hello, I'm writing a shell script which CATs a input file and subsequently runs an executable. Within each do-loop iteration the input file is changed. Here is where I'm running into trouble.... Lets say I want to add two decimals together: 1.25 + A A is a decimal with a range between... (2 Replies)
Discussion started by: modey3
2 Replies

6. Shell Programming and Scripting

adding value to variable using expr

for i `cat abc.txt` do m= `expr $i + 2` echo $m done i wrote this script to assing value to m. but i got the error "a.sh: 423: not found" please help me to sort out this issue (2 Replies)
Discussion started by: Kochu77
2 Replies

7. Shell Programming and Scripting

adding spaces for a variable value

Hi, i have to form the header and add fillers(spaces) to it. I have done something like this. i have added 10 spaces at the end HDR="AAAABBBBCCNN " echo $HDR >> file1.dat but the spaces are not being stored in the file. How to add the spaces. (2 Replies)
Discussion started by: dnat
2 Replies

8. UNIX for Dummies Questions & Answers

adding PATH variable

Hello i use bash and i added a path variable for 2 files /rscr and /uscr in /etc/profile /rscr working fine but the other one shows command not found and when i try to type whereis for scripts in /rscr it shows them but the other one shows nothing... thanks :b: (3 Replies)
Discussion started by: wir3d
3 Replies

9. UNIX for Dummies Questions & Answers

Adding PATH variable in the startup scripts

Hi, I got a error message The environmental variable AUTOSYS is not set ! I think I require to to add a path to PATH variable in the startup scripts in the home dir. I tried using set PATH= but it is not setting the PATH when i do the echo $PATH , i dont get the new PATH reflected, Is... (5 Replies)
Discussion started by: rajanishshetty
5 Replies

10. Shell Programming and Scripting

adding contents of a variable to a command

hi all, i'm new to shell scripting, so i'm not sure how to work this. Is it possible to read in the contents of a variable and add it to a command? for example: ------------------------ #!/bin/sh set example = -dfr rm ${example} ------------------------ when i run the script, i want... (2 Replies)
Discussion started by: gammarays
2 Replies
Login or Register to Ask a Question
AMT(8)							    BSD System Manager's Manual 						    AMT(8)

NAME
amt -- Abstract Machine Test Utility SYNOPSIS
amt [-m] [-p] [-q] [-s] DESCRIPTION
The amt utility is used to verify that the low level functions necessary to enforce requirements of the Controlled Access Protection Profile (CAPP) are working correctly. The amt utility must be executed with sufficient privileges and performs the following tests: Memory Read and Write This test allocates between 5% to 10% of physical memory and writes data to it, then reads the memory back to ensure the values writ- ten remain unchanged. Memory Separation and Protection This test ensures that user space programs cannot read and write to areas of memory that is protected or is not shared. Privileged Instructions This test ensures that the enforcement of the property that privileged instructions should only be in supervisor mode is still in effect. The set of privileged instructions tested to confirm this is architecture dependent. The options are as follows: -m Skip the memory test. -p Skip the privileged instructions test. -q Suppress the screen output. -s Skip the memory separation and protection test. EXIT CODES
<0 An error occured in executing the tests. =0 All the tests passed. >0 The number of tests that failed or were skipped. NOTES
The overall result (pass or fail) is logged in the audit trail and system log. The auditd(8) daemon must already be running for the results to be stored in the audit trail file. One of the above test may be skipped without getting a negative result. A test is skipped either with one of the above command-line options or automatically if there is not a test compatiable with the Target Of Evaluation (TOE). The audit administrator may want to perform the mem- ory test only on startup since it can have large negative impact on the system performance. SEE ALSO
audit(2) auditd(8) syslog(3) syslogd(8) BSD
August 14, 2008 BSD