Top "Ksh" questions

The KornShell is an open source, POSIX-compatible shell language from AT&T based upon the original Bourne shell.

How to mkdir only if a directory does not already exist?

I am writing a shell script to run under the KornShell (ksh) on AIX. I would like to use the …

shell scripting ksh aix mkdir
How to get the second column from command output?

My command's output is something like: 1540 "A B" 6 "C" 119 "D" The first column is always a number, followed by a …

shell awk ksh
Select unique or distinct values from a list in UNIX shell script

I have a ksh script that returns a long list of values, newline separated, and I want to see only …

bash unique distinct ksh sh
Reading file line by line (with space) in Unix Shell scripting - Issue

I want to read a file line by line in Unix shell scripting. Line can contain leading and trailing spaces …

shell unix ksh
Send password when using scp to copy files from one server to another

using scp to copy files from 1 unix server to another regularly and performing certain actions. to do this quickly I …

bash shell unix ksh scp
How to set the From email address for mailx command?

I am working on a KornShell (ksh) script running on a Solaris server that will send out an email when …

shell email solaris ksh mailx
Check if file exists and whether it contains a specific string

I want to check if file2.sh exists and also if a specific word, poet is part of the file. …

shell ksh
In a unix shell, how to get yesterday's date into a variable?

I've got a shell script which does the following to store the current day's date in a variable 'dt': date "+%…

unix datetime shell ksh hp-ux
Get exit code for command in bash/ksh

I want to write code like this: command="some command" safeRunCommand $command safeRunCommand() { cmnd=$1 $($cmnd) if [ $? != 0 ]; then printf "Error when …

bash unix ksh exit
How can I find a file/directory that could be anywhere on linux command line?

Ideally, I would be able to use a program like find [file or directory name] to report the paths with …

linux find ksh locate which