I'm trying to write a script (using sh) that will create dhcp.conf from a list of data. The part which I'm getting stuck on is how to specify a subnet range. Using Bash, the (( a=1, a<10, a++)) syntax works, but not in sh. Is there an equivalent way?
I was thinking about working from an IP address range specified like:
I can easily split this up using DOS batch language, but I don't know how to using sh. My intention is to (with the exception of 0 and 255), search a file for each IP address, and if found, construct the relevant information for dhcp.conf. I can even accept just writing the variables in the program rather than trying to parse those lines, but I still don't know how to loop through each IP address:
This is how I would do it in bash. BUT can it be done in sh?
for (( a=44; a<46; a++)); do
for ((b=1; b<255; b++)); do
The alternative is to not use sh at all. But I wanted to because I thought it was 'standard' as far as shell scripting goes. Am I mistaken here... ie. is 'bash' seen as standard and pretty much guaranteed to be installed on any system?