Quote:
Originally Posted by
Katkota
I think passing the file name with one argument should work.
Yes, until you have a filename of "var=val", which is possible. Of course you can first examine every argument passed and if a file with that name exists, take it as a filename and if not, then examine if it is a well-formed item of the form "var=val". This is possible but it is easier (read: saves programming effort) to distinguish (for the script) between filenames and arguments up front.
Quote:
Originally Posted by
Katkota
I don't care which ksh we use but I think ksh93 is more advanced
Yes, but it won't matter that much here. It is quite possible to do it in both ksh-versions. Notice, though, that what some Linux-distributions (i have no experience with RedHat) have labeled as a Korn Shell is in fact not a real Korn Shell but something awful (mksh, pdksh, etc.).
I say that because one of my scripts just failed on a SLES 12 system, whereas it ran perfectly on SLES 11. Upon inspection we found that SLES 12 has only "pdksh" (which is a mixture of a bash-like shell and some ksh-isms but not even compatible with ksh88) but names it "ksh". In fact the original ksh is not even in the SLES-12-repository.
What have you tried so far and where were you stuck?
I hope this helps.
bakunin