The Korn shell (ksh) is a shell with advanced scripting features, commonly found on commercial unices and some BSD systems but rarely used on Linux.

learn more… | top users | synonyms

4
votes
5answers
4k views

Next day of the user entered date - date +1 day

I am new to scripting I needed a script in the AIX environment to get the next days date based on the date entered by the user of the script. After hard time browsing for this I got a piece of code ...
1
vote
2answers
260 views

viewing variable values in a KSH script

I am using a KSH script that creates numerous variables from fairly complex code. What command can I place in the script to view the value of these variables as they are created? Would ECHO be the ...
3
votes
1answer
500 views

KSH styling text based menu using STDERR

Is it possible to format the STDERR in order to have a better looking menu using the select command? I have a simple select select oChoice in $(<tempMenu.menu) ; do case "$oChoice" in ...
1
vote
1answer
13 views

Remote ssh command not sending echo variable from a ksh script on AIX

I'm need to get the value of a variable from a remote host in a script using SSH and have to source an environment file first that does a shift at the end of its run. The command works locally and I ...
1
vote
1answer
204 views

How to give variable to a KSH script with a CGI?

index.sh is in the cgi-bin directory: #!/usr/bin/ksh echo 'Content-type: text/html <html><body> <form action=FOO.KSH method=POST> <input type=submit value=fgrep ...
1
vote
1answer
327 views

How do you track memory usage in a ksh93 script

We have a number of ksh scripts that run forever (inside a while loop), or at least until a shutdown event is delivered to them. We had a project where these scripts where converted to ksh93 (and ...
0
votes
1answer
177 views

Error unzipping file through ksh, unzip works through bash

I have an auto-generated zipfile foo.zip on a Red Hat server that needs to be extracted to a particular location /bar. This is done through an install script using ksh. When the script executes unzip ...
0
votes
1answer
54 views

KSH script missinterpreting alias stored in SQL oracle DB

I have stored the path of my file in a table with as an alias (as the complete path was too long for the table's field). However, in my KSH script, when I am doing : nomtmp=`sqlplus -S bla/bla ...
0
votes
1answer
81 views

ksh, perform action when reaching loop maximal value

I am looking to write a small korn shell script doing 5 tests (by waiting some time before each one) and then, if they all fail, performing an action. I was looking at doing something like : for ...
0
votes
1answer
795 views

Using alias in another script (ksh)

I'm writing a ksh script, and I'd like to use a command define by an alias in my .profile file, in my script. I tried this command in the folder containing my script, and it works. However, in my ...
-2
votes
1answer
21 views

split in different lines every match of the same line

I have a code like these: , Select code from sales group by id.... I would like to have three lines like these: , Select code from sales group by id...... Someone can help me how could I do ...
1
vote
0answers
551 views

Dynamic search and replace in Ksh

Machines at work follow a constant naming pattern: host[domain]_[id] where [domain] is either "d" for dev machines and "p" for production machines, and [id] is a 2-digit string that is different for ...
0
votes
0answers
15 views

Sigstop when trying to run script?

I am trying to list out all commands by users, unfortunately I hit a weird sigstop that I am not sure how to diagnose? #!/bin/ksh echo '[' for USER in `cut -d: -f1 /etc/passwd |sed '/^#/ d'`; do ...
0
votes
0answers
55 views

How to run multiple queries in a KSH script

I have a KSH script that has one SQL Query and generates and emails output of the query in HTML format. I want to change the script so that it has three SQL queries and the last query generates and ...
0
votes
0answers
64 views

How to capture INFORMIX DB errors in shell script?

I need to capture the informix DB errors like Update failed, Insert failed using the shell script. I am using ksh shell.