I'm using ipappend and getargs.com with a dos boot image to get the environment variables for the IP and MAC. The format of the %ip% environment variable is ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> Is there a way to tell ipappend to assign these to individual arguments. Or does anyone know a good way to parse each of these to individual variables in dos. What I want to get is clientip bootserver gw netmask And for the MAC the format is something like BOOTIF=00-00-00-00-00... Anyone know how to strip out the dashes. Thanks -Aaron
> I'm using ipappend and getargs.com with a dos boot image to > get the environment variables for the IP and MAC. The format > of the %ip% environment variable is > ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask>where can I get getargs.com? Cheers Alex
Couple of DOS based solutions... ** METHOD 1 ** http://www.pressroom.com/~tglbatch/pdate.html has a DOS Batch file to parse the current DATE. You may be able to use this to parse the ip address as well. ** METHOD 2 ** Another useful utility is "SENVAR.COM" (google search: first hit), it allows you to store the first line of any DOS program's output. If you can find a DOS port of the unix command "cut", you are in business. I have seen Native Windows ports (unxutils.sourceforge.net) but not yet come across a DOS port. ** METHOD 3 ** Should be simple to write a small C program which implements "cut -f1 -d':' 12:34:56:78". This together with the SENVAR.COM (512 Byte COM file) should do the trick. - Murali Aaron McSorley wrote:>I'm using ipappend and getargs.com with a dos boot image to >get the environment variables for the IP and MAC. The format >of the %ip% environment variable is > ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> >Is there a way to tell ipappend to assign these to individual arguments. >Or does anyone know a good way to parse each of these to individual variables in dos. >What I want to get is > clientip> bootserver> gw> netmask> >And for the MAC the format is something like > BOOTIF=00-00-00-00-00... >Anyone know how to strip out the dashes. > >Thanks > -Aaron > > > >_______________________________________________ >SYSLINUX mailing list >Submissions to SYSLINUX at zytor.com >Unsubscribe or set options at: >http://www.zytor.com/mailman/listinfo/syslinux >Please do not send private replies to mailing list traffic. > > > >
http://garbo.uwasa.fi/pc/unix.html has the C code for a lot of Unix utilities which can be compiled for DOS. You can just grab cut.c (from the file cut.zip), and compile it to a .COM file using OpenWatcom compiler (wcl -3 -osx -mt cut.c). This together with SENVAR.COM should do the trick. - Murali Aaron McSorley wrote:>I'm using ipappend and getargs.com with a dos boot image to >get the environment variables for the IP and MAC. The format >of the %ip% environment variable is > ip=<client-ip>:<boot-server-ip>:<gw-ip>:<netmask> >Is there a way to tell ipappend to assign these to individual arguments. >Or does anyone know a good way to parse each of these to individual variables in dos. >What I want to get is > clientip> bootserver> gw> netmask> >And for the MAC the format is something like > BOOTIF=00-00-00-00-00... >Anyone know how to strip out the dashes. > >Thanks > -Aaron > > > >_______________________________________________ >SYSLINUX mailing list >Submissions to SYSLINUX at zytor.com >Unsubscribe or set options at: >http://www.zytor.com/mailman/listinfo/syslinux >Please do not send private replies to mailing list traffic. > > > >