Since ksh93 is now [1] available for most version of UNIX (and Linux), we have been tentatively moving our courses (especially scripting) towards the new syntax. At the moment the scripting course is still based predominantly on the pre-93 versions, but we now introduce a fair amount of comparisons, 'gotchas' and demos of new capabilities and syntax.
Truth is, months later we still find new idiosyncrasies.
Here is one I found today, whilst teaching... Imagine the following example, to illustrate the need for double quotes when creating and accessing variables:
If you want to assign a value that has leading or trailing spaces or tabs, you need the quotes:
$ address=" 6 Pie Corner"
Would you expect to see the leading spaces if you didn't use the quotes when accessing the variable? Of course not! Well, in ksh93 it works! Haven't checked yet if this behaviour is driven by any particular setting or switch, but in my CentOS 5 ksh (Version M 1993-12-28 r), the following worked out of the box:
$ print -- $address
<space><space>6 Pie Corner
[1] in the original posting this said 'not' - corrected 18/10/2007
Twitter Updates
G-AVLN in front of her home
Mostly Unix and Linux topics. But flying might get a mention too.
Subscribe to:
Post Comments (Atom)
Blog Archive
- October (1)
- June (1)
- April (2)
- February (3)
- June (1)
- March (1)
- August (3)
- July (2)
- June (1)
- March (1)
- June (3)
- May (1)
- April (5)
- February (1)
- January (5)
- October (1)
- September (3)
- July (4)
- June (5)
- April (3)
- March (1)
- February (3)
- January (3)
- October (7)
- August (2)
- July (3)
- May (1)
- November (4)
- October (1)
- September (1)
- August (2)
- July (2)
- June (3)
- May (3)
- April (2)
- March (2)
- February (3)
- January (1)
- December (2)
- November (1)
- October (6)
- September (6)
- August (1)
- July (2)
- June (8)
- May (3)
- April (4)
- March (3)
4 comments:
1. ksh93 is available on most Linux distributions, including SUSE and Debian
2. ksh93 is available on Solaris: http://www.opensolaris.org/os/project/ksh93-integration/
That's correct. So does RedHat (hence Fedora and CentOS), and HP-UX, and AIX, indeed any version of UNIX that uses ksh either already provides the ksh93, or has the capability to add it.
I wonder if I have missed the point of your comment...
I think he was wondering about the "not available" in your "Since ksh93 is not available"...
AFAIK you were thinking about "now", not "not", right?
Did you read the ksh93 code style guide yet?
Post a Comment