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

1
vote
2answers
644 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 ...
0
votes
2answers
41 views

pausing a loop in AIX to wait for user input

I'm searching for a scripting mechanism that can realize the following idea. Loop over a list and stop/wait on "read x" until the next input from a user. I know the following script is not working! As ...
0
votes
2answers
692 views

Database: 0403-009 The specified number is not valid for this command

getting the error as Database: 0403-009 The specified number is not valid for this command. Code:: #!/usr/bin/ksh #set -x WORKFILE="/tmp/oatest.out" DDLFILE="/tmp/oatest.ddl" TODOFILE="/tmp/...
4
votes
1answer
844 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 ...
2
votes
1answer
58 views

How to know log the full script name executed by user?

I want to log the full name of the script executed by the user including the options/arguments he provided to that script. I was able to achieve some success using basename and whoami but it does not ...
2
votes
1answer
185 views

SFTP Dual Factor Authentication

My Issue I am trying to automate a file fetch from an external [SFTP] server. The server is using 2-factor authentication. First, it needs a public-private key pairing established [This has already ...
2
votes
1answer
547 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 ...
1
vote
1answer
61 views

Bash - Running a bash script from within a ksh script

I am on RHEL 6.7 and have a korn shell script that does check pre-reqs, prepares the system for rpm install's (creating directories if they are not already that are required by the product), stops ...
1
vote
1answer
48 views

Return long integer value from a function in ksh

I use the below function in ksh to return the long value of date parts function convert_date_to_long { long_date="${1}${2}${3}" return $long_date; } but the result i get is 209 when i ...
1
vote
1answer
18 views

Script to see /mysqlshare is present in all list servers, doing only first iteration

I need to get /mysqlsharedetails from all the MySQL servers. I have written a script using a while read loop, but it's getting the details of only the first server, #!/bin/ksh file="/home/mysqladm/...
1
vote
1answer
243 views

Find files older than a given file - a few hours

I'm using the following to find all files that are older than a reference file... find /home/testuser -name "dummyfiles*" ! -newer referencefile.txt ... which works as expected. However, I want to ...
1
vote
1answer
85 views

Catenation of two commands to a file and email output

#!/bin/ksh #HOSTS format: HOSTS="xxxx.xxx.xxx.xx-ACCOUNT" FILE=/home/angela/list.txt #list will be saved on list.txt date > $FILE echo >> $FILE for host in $HOSTS; do ip=$(echo $host|...
1
vote
1answer
229 views

How can I see history of the “at” command in AIX?

I'm experiencing a strange problem where occasionally the at command appears to not be running the command I've configured it to run. For example: at -t 201510071042 runsomescript <Ctrl-D> ...
1
vote
1answer
498 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 style=width:...
0
votes
1answer
17 views

KSH password generator

How to make sure the generated passwords contains all these special characters: ?!/=\? Currently I'm using: pwd_usr["$i"]=`cat /dev/urandom|tr -dc "a-zA-Z0-9-_\?\!\=\/\"|fold -w 15|head -n 1` But ...
0
votes
1answer
29 views

Parsing a delimited in ksh as command argument

My system generates a flat file with 7 arguments : Field1,Field2,Field3,Field4,Field5,Field6,Field7 Field1,Field2,Field3,Field4,Field5,Field6,Field7 Field1,Field2,Field3,Field4,Field5,Field6,Field7 ...
0
votes
1answer
43 views

cannot reload .profile from script

I am trying to reload .profile from the below script, but that doesn't work at all. #!/bin/ksh sed -i '/export rel=Rel1510_Linux/c\export rel=Rel1602_MX' ~/.profile source ~/.profile When I run ...
0
votes
1answer
92 views

ksh: Not importing prompt settings from /etc/profile

I am using SUSE Linux Enterprise Server 11 SP3 and I am facing an issue related with a user using ksh. I have created a user as follows: testenv:$2y$10$vjUVUejLhMGoTn2CHPqmU....
0
votes
1answer
181 views

Retrieving prompt information in ksh?

If there is a prompt being read for a value such as: #!/bin/ksh echo "What is your name?" read name username=$name rcmd machine1 grep $username /path/locnames >> namefile rcmd machine1 cat ...
0
votes
1answer
129 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
2k 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 ...
-1
votes
1answer
92 views

How to change shell from script

I want to change shell from ksh to bash and source the .kshrc file. I want to execute following lines of command sequentially: bash . ~/.kshrc clear Can anybody help me?
-1
votes
1answer
45 views

Whats wrong with the 2nd script?

I am new to linux and scripting. I have some concerns regarding the script below which creates folder per line from file. Folder.list is located in /scripts/ . 1st script works smoothly but the 2nd ...
-2
votes
1answer
51 views

KSH for generating 'n' of rows for a table dynamically : Issue with if else statement

I need to generate billion of records in a text file for table loading purpose. My destination table defination is: CREATE TABLE txnrecords12( txnno int, txndate string, custno int, ...
1
vote
0answers
11 views

Returning an array from a ksh93 function

I would like to return an array from a function in ksh93. At this point, using the following method, the contents of the array are passed as a single element even though, in the fonction, the array ...
1
vote
0answers
61 views

Background processes in ksh script are disappearing after they are kicked off

I'm having an issue with a KSH script that is supposed to kick off four processes in parallel in the background and then poll their status. Put simply, running the four processes sequentially would ...
1
vote
0answers
65 views

Siemens NX 10 installation: Could not determine filesystem containing /usr/ugs100

I debug script to install Siemens NX 10 applications for Debian 8.2, and get the warning: Could not determine filesystem containing /usr/ugs100 space calculations may be incorrect. The source ...
1
vote
0answers
197 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
19 views

Unable to print msg to console from subscript

I am calling a ksh script file from another as given below runCommand "qc_data" Here qc_data is a ksh script file. in runCommand i execute the command as below function runCommand { ...
0
votes
0answers
65 views

ksh script to ftp file to remote directory script

hello I have this script, basically I need to ftp to remote server only the new files for example that will be generated today or by date, so it does not import the old files, just the new ones I have ...
0
votes
0answers
68 views

Is the pipe overloaded?

I am using a coprocess to run commands in siebel server manager. I am reading commands from a text file (around 2000 commands) and executing them one by one in siebel server manager. After executing ...
0
votes
0answers
795 views

telnet command with custom timeout duration

I'm trying to execute telnet command and getting the out put on shell script. But when the port not open or the ip not exist. The command take too much time to give the response. Will it be possible ...
0
votes
0answers
178 views

Avoiding heredoc sh[process_number].* files in /tmp directory

I have a .ksh file which logs into sqlplus and runs some queries. The block of code is something as mentioned below: //Other things done in ksh sqlplus -s @connect.sql << EOF Query1 Query2 ...
0
votes
0answers
47 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
778 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 ...