hi!
i have two problems with the following script who prepares a date (removes the heading zero from day if day<10) for arithmetical operations:
<script>
#!/usr/bin/sh
DAY=`date +%d`;
echo 1 - $DAY;#i.e. 06
DAY=${DAY#0};
echo 2 - $DAY;#i.e. 6
</script>
- every time i run this script on SunOS 5.7 (SPARC) i get a 'bad substitution' error (only) if the first line isn't blank
- every time i run this script on SunOS 5.6 (SPARC) i get a 'bad substitution' error (no matter if the first line in blank or not)
thanks