please have a look at the following:
I believe it meets the requirements of the assignment. Let me know if you run into any issues.
OK, will do.
Here's a commented version:
how are you invoking the script? What OS and command shell are you running under?I just tried the script in a few simple cases in a cygwin environment and it performed as expected...
Perhaps you could take (and upload) a screen shot of the window where you're trying it out to give me some context.
OK, I don't immediately see a problem there...
but I haven't been around Sun OS in quite some time, and it's seems there are some differences in the ksh implementation..
Can you verify that the ksh shell is actually present (i.e. is there are /usr/bin/ksh ?)
Also, you can try this version (same link, new file)
Not the change is only on the first line, to force using the traditional version of ksh as suggested here:
I'm not sure it applies here because you seem to be on Solaris 9, not 11 (SunOS5.9 == Solaris 9) .. but worth a try anyway.
A final note; it is possible that somehow the script itself got corrupted during transfer to you... how did you get it to your machine?Did you by any chance open it in a browser, select the text and past it into a local file (editor window)? THat can cause problems...
Hi, did you have any luck with my suggestions?
Well I'm afraid the issues continue to look like they're due to the differences between Solaris and Linux/GNU, where I originally developed that script. The latest problem stems from the Solaris "find" utility not supporting the "-printf" switch - I found some comments about this here:
As it suggests, if the GNU utilities (e.g. find) are installed on your Solaris box (under /opt/sfw perhaps, or /usr/sfw or /usr/local/bin) then we could adjust the script to use them explicitly rather than the Solaris 'find' .
It's hard to tell what other problems may exist, because once the first error in 'find' is encountered, the rest of the errors are most likely just a direct consequence and may just go away if we can use the GNU version of 'find'
I don't have access to a Solaris environment, so I'm afraid I can't rewrite the script using the constraints of the native Solaris tools, which could be even more tedious because your Solaris version is fairly old.
Here's another post related to that topic: