![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Newbie
Join Date: Jun 2006
Location: In a box
Posts: 27
Rep Power: 0
![]() |
Help with this code
ITERATE=240 for COUNT in `seq -w 1 $TOTAL` do OTHER=$(($COUNT*2)) ... more stuff ... done Is there a way I can multiply this number by two, while still interating through by one?
__________________
~ Silicon Enhanced Pudding "It's magically delicious" |
|
|
|
|
|
#2 |
|
Unverified User
Join Date: Aug 2005
Location: none
Posts: 146
Rep Power: 0
![]() |
Don't use the -w option on seq. Many things interpret numbers starting with 0 as octal (base 8), likewise with 0x and hexadecimal (base 16).
__________________
Warning: My posts may change (dramatically) within the first 15 minutes they're posted. Got 'Nux?—GNU/Linux and other free software support. It's GNU/Linux, not just Linux. |
|
|
|
|
|
#3 |
|
Newbie
Join Date: Jun 2006
Location: In a box
Posts: 27
Rep Power: 0
![]() |
I need the -w option to keep the 000 spaces in front of the number. Is there another clean way to do this?
__________________
~ Silicon Enhanced Pudding "It's magically delicious" |
|
|
|
|
|
#4 |
|
Programmer
Join Date: Sep 2005
Posts: 50
Rep Power: 3
![]() |
try this:
previously declare variable OTHER and set it to 0 then in the loop: let OTHER="$COUNT"*2 |
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| EXECryptor software protection | Jean5 | C++ | 35 | Oct 10th, 2006 7:10 PM |
| Little help | whoawhoayoyo | Assembly | 8 | Apr 18th, 2006 7:10 PM |
| How to post a question | nnxion | C++ | 10 | Jun 3rd, 2005 11:53 AM |
| How to post a question | nnxion | C++ | 0 | Jun 3rd, 2005 8:55 AM |
| How to post a question | nnxion | C | 0 | Jun 3rd, 2005 8:55 AM |