Trying to battle an image scripting problem. I think there is some issue with how the script is going from the browser into the db, or maybe when its passed down to pxe environment.

Anyway, simple script:
img pdall
sleep 4
img pc1 fat16 10
sleep 4
mkfs.msdos /dev/sda1
sleep 4
img rp $PROXYADDR sysprep_template.zmg
sleep 4
mount /dev/sda1 /mnt/harddisk

Created this script. went into my PXE environment. Did an "img auto" to pull down the script, then did a "cat /bin/zenAdvancedScript" to make sure it was right one, then did "sh /bin/zenAdvancedScript" to run it.

Results in a bunch of "sleep: invalid time interval '4\r' errors

I'm basically having problems with many commands that are seperated by commas or maybe hardreturns at the ends.

I dont even know where to begin testing this. If I run the commands manually at the #, they work fine, its only when called from the imaging script where I have issues.

Please help