View Full Version : help with bash variables?
cannibalbob
June 30th, 2005, 10:02 AM
I need a variable to = 001 NOT 1... so when i use N = `expr 001 + 1` it results as 002 NOT 2...
any ideas?
:-?
LordHunter317
June 30th, 2005, 10:30 AM
You want to take 001 logical NOT 1? That's 110... you need to give more information, I have no clue what you're even trying to attempt.
cannibalbob
June 30th, 2005, 11:12 AM
no... not logic. like this:
N=001
M=N+1
now M = 2 rather than 002...
LordHunter317
June 30th, 2005, 11:25 AM
Few ways you can do it:a=1
b=`expr $a + 1`If you want to be restricted to bash and most ksh shells, you can also say:a=1
b=$((a+1))
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.