Results 1 to 2 of 2
Hi all,
Would like to know how this substitution works?
Code:
Would like to know how these substitution works??
Code:
FINISHED="Done"
x=126
COLS=$((${x} -${#FINISHED} - 5))
here does the #FINISHED ...
- 05-31-2008 #1Just Joined!
- Join Date
- May 2008
- Posts
- 20
how does this substition work?
Hi all,
Would like to know how this substitution works?
Code:Would like to know how these substitution works?? Code: FINISHED="Done" x=126 COLS=$((${x} -${#FINISHED} - 5)) here does the #FINISHED give the ascii value of "done" ,or how does it work? Thanks
- 05-31-2008 #2
hi
here is how it works.
1) first bash calculates ${#FINISHED} and that yields 4 ( ${#FINISHED} is the length of the variable FINISHED which contains 4 characters( "Done")) .
2) then it calculates 126 - 4 - 5 = 117
3) then it puts it in COLSLinux and me it's a love story


Reply With Quote