KSH Shell

KSH: Import File With Variables and Functions

by Vivek Gite on September 20, 2011 · 0 comments

How do I import variables and functions defined in lib.ksh script to another ksh script called setup.ksh under Linux / Unix like operating systems? How do I execute commands from a file in the current KSH shell?

{ 0 comments }

How do I check ksh version? How do I find out ksh version under UNIX like operating systems?

{ 4 comments }

HowTo: Unix For Loop 1 to 100 Numbers

by Vivek Gite on January 16, 2010 · 0 comments

I want to run a Unix command 100 times using a for loop from 1 to 100. Can you tell me how to take a block of numbers in a loop under KSH or BASH shell?

{ 0 comments }

Ksh Read a File Line By Line ( UNIX Scripting )

by Vivek Gite on November 20, 2009 · 8 comments

How do I read a file line by line using KSH shell scripting under UNIX like operating systems?

{ 8 comments }

If var is defined AND NOT EMPTY, use var, otherwise set a default variable under Bash. For e.g. my script needs a parameter for output variable. It can be text or html. I set it as follows in my script

output=$1 # either text or html

However, sometime user forget to pass the parameter to my shell script and my enter logic fails. So how do I set default value to text, if no parameter passed?

{ 6 comments }

Shell Script While Loop Examples

by Vivek Gite on July 16, 2009 · 10 comments

Can you provide me a while loop control flow statement shell script syntax and example that allows code to be executed repeatedly based on a given boolean condition?

{ 10 comments }