Tag Archives: shells

Variable sizes in KSH

It looks like the POSIX shell doesn’t support variable sizes greater than 2 Gigabytes. In the following example, the LIMIT variable is of 1 Gbyte, and the VALUE is 4 GBytes. # LIMIT=1073741824 # VALUE=4294967296 # if [ $LIMIT -lt $VALUE ] > then > echo “exceeds limit” > else > echo “passed” > fi [...]

UNIX95 variable influences to the ps command

Setting UNIX95 to some value (it doesn’t matter what it is) changes the behavior of the ps command to use the XPG4 environment instead of the HPUX environment. You can see all the different command line options and the XPG4 behaviors by looking at the man pages (e.g. man ps). Several options like ps -o [...]

Correct usage of ulimit

The “ulimit” and “limit” commands are often built into the shell, but there may exist some binaries with the same name. For example: # /usr/local/bin/bash bash> type ulimit ulimit is a shell builtin bash> which ulimit /usr/bin/ulimit

Advanced scripting – changing the UID of a user

At one of our customer we will have an monstre’ UID-consolidation projekt in the near future. For this purpose I’ve written a script to enlighten our task. Most of you thinks at it a an over-complicated (usermod && find …. chown …) job, but my script has undergone some performance optimisation too: it starts parallel [...]

Differences between shells

Here is a comparison matrix I’ve found on www.faqs.org: sh csh ksh bash tcsh zsh rc es Job control N Y Y Y Y Y N N Aliases N Y Y Y Y Y N N Shell functions Y(1) N Y Y N Y Y Y “Sensible” Input/Output redirection Y N Y Y N Y [...]