| |
11-25-2005
|
#11 (permalink)
| | Trusted Penguin
Join Date: Jan 2005 Location: Boston, MA, USA
Posts: 2,691
| No problem with helping. I actually don't know much Bash myself, so it's a bit of a learning experience for me too. That's why I use Perl for everything  .
Anyway, as far as that substring thing, no. Because you're doing (0,3), which, because 3 is exclusive, would return characters 0, 1, 2 ("tes"). You need to do "${word:0:4}".
Another way of thinking is that you start with the first number, and end right before the second number. So we start at 0, and end right before 4.
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
|
|
11-25-2005
|
#12 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| Quote: |
Originally Posted by Cabhan No problem with helping. I actually don't know much Bash myself, so it's a bit of a learning experience for me too. That's why I use Perl for everything  .
Anyway, as far as that substring thing, no. Because you're doing (0,3), which, because 3 is exclusive, would return characters 0, 1, 2 ("tes"). You need to do "${word:0:4}".
Another way of thinking is that you start with the first number, and end right before the second number. So we start at 0, and end right before 4. | ok, cool. i got it
thank you so much. i'm very close to getting it finished. now i just need to adjust the 2.6 section for 2.4, add if-then's for the bootloader that the person chooses, and add the code to add lines to the bootloader  |
| |
11-25-2005
|
#13 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| ok...i finally finished writing it. i'm testing it now with a new kernel to see how it works and if there are any bugs
i'll start a new thread in "Linux Applications" with this program in it and what it does in detail tomorrow
thanks you very much for helping me write this  |
| |
11-25-2005
|
#14 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| there was a small bug and i'm probably just going to avoid it. when it adds to grub/lilo, the entry is now placed too high (i didn't think about this earlier). it's added above the options at the top of the config files. so, i'll probably add it to the bottom instead and give the user the option of using the kernel if he or she wants by moving down to it...or maybe place it at the top but re-add the settings and make them the original grub/lilo defaults. i'm not sure yet. what would everyone rather have? |
| |
11-25-2005
|
#15 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| Quote: |
Originally Posted by josolanes there was a small bug and i'm probably just going to avoid it. when it adds to grub/lilo, the entry is now placed too high (i didn't think about this earlier). it's added above the options at the top of the config files. so, i'll probably add it to the bottom instead and give the user the option of using the kernel if he or she wants by moving down to it...or maybe place it at the top but re-add the settings and make them the original grub/lilo defaults. i'm not sure yet. what would everyone rather have? | ok...i decided to just add the new kernel to the bottom of the grub.conf/lilo.conf file, as i don't think i'll be able to place it where i want it. oh well. i'll post the code in the "Linux Applications" section soon. how would you all recommend i post this so that people can easily use it? i was thinking about just posting the code, but that would come up to 331 lines of code  . is there a way for me to post just the program, to be dowlnoaded and readily executable? |
| |
11-25-2005
|
#16 (permalink)
| | Trusted Penguin
Join Date: Jan 2005 Location: Boston, MA, USA
Posts: 2,691
| Since I don't know Bash, I dunno if this is doable, but is it possible to read the file into an array until you reach the first actual kernel boot statement, then rename it, write the file that you read (the top statements) to the file, write the new kernel to the file, and then write the old one below that?
As far as posting the program, just put it online and link to it. That way, people can look at it and download it easily.
__________________
DISTRO=Gentoo
Registered Linux User #388732
Gentoo Linux, 410 GB HD, 1.2 GB RAM, Fluxbox, These are a Few of my Favorite Things
|
| |
11-25-2005
|
#17 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| Quote: |
Originally Posted by Cabhan Since I don't know Bash, I dunno if this is doable, but is it possible to read the file into an array until you reach the first actual kernel boot statement, then rename it, write the file that you read (the top statements) to the file, write the new kernel to the file, and then write the old one below that?
As far as posting the program, just put it online and link to it. That way, people can look at it and download it easily. | the first part confused me some, but i understand what you mean  .
i don't know how to do arrays within bash....if i can find out how to, i would be willing to add that. it would make it a little bit easier to move from kernel to kernel (automatically would boot to it at restart). I found a nice site to look at regarding this ( http://www.linuxvoodoo.com/resources...de/arrays.html) and am now reading through it to see how i would write the script
for posting the program, you mean use something like www.yousendit.com to host the file temporarily and post the link? that's the only way i know of doing this so far |
| |
11-27-2005
|
#18 (permalink)
| | Linux Enthusiast
Join Date: Jun 2005 Location: Odessa, FL
Posts: 586
| OK...i've posted the program in the Linux Applications section. It runs perfectly from what I can see and I hope it is of some use to you Link to thread |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | | | Thread Tools | | | | Display Modes | Linear Mode |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | |