Header Shadow Image


ksh and ksh93: line arithmetic syntax error

While using associative arrays, I run into this little issue using this sample KSH93 code: #!/bin/ksh93u+ function scmp {         typeset -A IPAA;         # Load First File.         for KEY in $(cat 1.rip); do                 IPA1[KEY]=1;         done         # Load Second File.         for KEY in $(cat 2.rip); do                 IPA2[KEY]=1;         done [...]

ksh and ksh93: 0: not found [No such file or directory]

When assigning values to an associative array in KSH, it's important to note the significance of the $ value:   # typeset -A ABCD; $(( ABCD["moi"]=0 )); $(( ABCD["moi"]++ )); $(( ABCD["moi"]++ )); $(( ABCD["moi"]++ )); print ${ABCD["moi"]}; /bin/ksh93u+: 0: not found [No such file or directory] /bin/ksh93u+: 0: not found [No such file or [...]

RANDOM numbers in ksh or ksh93

Here's are an example of a random number generator in KSH or it's newer counterpart KSH93.  For this post, we'll use the latest KSH from AT&T Labs: Generate a random set of integers between 0 – 256 and use them to create a random set of IP type entries: #!/bin/ksh93u+ for (( KEY=0; KEY < [...]

What is my unix shell version?

There's several ways to determine the ksh version.  All will print different results depending on the KSH you're running.  Here are the methods for finding the versions:

How to create a for loop to print a sequence or range of numbers on DD-WRT or busybox devices: Linux

DD-WRT run what's known as a busybox, which is a single tiny executable designed to run on enbedded devices.  busybox provides common UNIX utilities normally found on larger UNIX / Linux installations such as desktop computers.  Unfortunately it's limited and even with the shell it provides, alot of functionality such as common shell loops no [...]

AWK for Human Beings

This is a quick and dirty AWK tutorial demonstrating the most common usages and features that one can use on a daily basis by human beings.  Three variants: AWK standalone, integrated into ksh, and one-liner are provided.    On my system, AWK pointed to GAWK.  GAWK has an expanded command set but here we will [...]

MySQL DB backup.

One of the things you definitely want to take a backup of on a regular basis, especially if you are a WebAdmin/WebMaster is that of your MySQL database for things such as a forum, blog or anything else you have that may use MySQL on your site. For this you'll need telnet/ssh login to allow [...]

C# VS Java / Python VS Perl popularity.

Was interested tonight how well Java (A language I know) is doing against other languages such as C# (One that I don't know). I'm also something of a Bash/Ksh and Perl buff so I was also interested in popularity indexes as well. I remembered earlier a site I had used to check for this.  I [...]


     
  Copyright © 2003 - 2013 Tom Kacperski (microdevsys.com). All rights reserved.

Creative Commons License
This work is licensed under a Creative Commons Attribution 3.0 Unported License