problem with set -A in ksh


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting problem with set -A in ksh
# 1  
Old 07-08-2004
Data problem with set -A in ksh

I am trying to load a file into an array by using the set -A command in the ksh.

The file contains a comma delimited record of 19 fields and is 5196 records long. If I execute the following command, I get the record count.

cut -f1-19 -d',' -s RAGEFF.lst|sed 's/,/ /g'|sed 's/\L//g'|nawk '{ if (NF == 19) {print $1}}' |wc -l
5196

If I execute the following command I get a "subscript out of range" error.

set -A CustNo `cut -f1-19 -d',' -s RAGEFF.lst|sed 's/,/ /g'|sed '
s/\L//g'|nawk '{ if (NF == 19) {print $1}}' `
/bin/ksh: 5195: subscript out of range

I have searched everywhere that I can find for a maximum array size in the ksh, but could not find anything. Can anyone help me eliminate this errror?

Last edited by beilstwh; 07-08-2004 at 02:08 PM..
# 2  
Old 07-08-2004
The man page says: "The value of all subscripts must be in the range of 0 through 1023". From this you can infer that max array size in ksh is 1024.
# 3  
Old 07-08-2004
Rats!!! Oh well, I guess I will rewrite it in PERL. Thanks very much for the Info.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

ksh - variable to be set to windows path issue

Greetings Experts, I need to pass a parameter to ksh and the value is windows path eg: sh abc.txt C:\Users\chill3chee\Desktop No matter I try with \ delimiter, still could not get this exact value assigned to the shell variable which was checked with echo. Tried with using... (2 Replies)
Discussion started by: chill3chee
2 Replies

2. Shell Programming and Scripting

"ksh: XYZ: parameter not set" in .profile

Hi, A very basic query. I am working on two different UNIX servers and I see different behaviours for my user id. This has to be a setting in the .profile, but I can't seem to find where :confused: So, in one server if I type echo $XYZDD (a random variable), I get a blank line with no... (2 Replies)
Discussion started by: ALDonP
2 Replies

3. Shell Programming and Scripting

Unable to set PATH through ksh shell

I'm trying to set path for the current session but it is not doing so. It works perfectly on command line though. #!/usr/bin/ksh PATH=$PATH:/opt/quest/bin Is there any specific way to set path on korn? (3 Replies)
Discussion started by: pjeedu2247
3 Replies

4. UNIX for Dummies Questions & Answers

Character set problem

Hi, I'm trying to edit a file with vi, but all special characters (áéíóú etc) don't seem to show correctly. They don't seem to be supported by the OS (SunOS 5.10). I'm using MobaXterm as the terminal emulator, which is configured to use ISO-8859-1. The same charset is used on Solaris. If I open... (4 Replies)
Discussion started by: Subbeh
4 Replies

5. Shell Programming and Scripting

set ksh script in restricted mode

Hi, I came across a post wherein you can use "set -r"(on bash) to activate restricted mode ( wherein you cant run some commands such as cd etc). Can anyone guide if we have anything similar in ksh ? Thanks (2 Replies)
Discussion started by: Shivdatta
2 Replies

6. Shell Programming and Scripting

KSH script eval(?) to set variable

first of all, thanks to all on this board, it has been a huge resource to answer most of my questions! I am stuck on something that should really be simple, and was looking for some help.. I am using KSH on solaris and working on a script to move containers from server to server. Where i am... (4 Replies)
Discussion started by: tksol
4 Replies

7. Shell Programming and Scripting

KSH, FTP running a set number at a time?

At work we have a script that pulls a file from a list of remote sites every 10 min. Currently it only does this ftp one sites at a time and this process takes up to 8 minutes to complete. I want to have this list of 24 sites and be able to run the ftp from up to 2 sites on the list at a time. I... (1 Reply)
Discussion started by: kofs79
1 Replies

8. Shell Programming and Scripting

set Working day in ksh

Hello guys it´s a pleasure to type with the unix community...I´m new in shell script and I need to insert into a #!/ksh a statment that will check if a file that I´ll receive from another script is arriving in the first working day of each month: let´s say that I´ll reveive the following files... (1 Reply)
Discussion started by: Rafael.Buria
1 Replies

9. Shell Programming and Scripting

Ksh script - Design ? - Search file and set variables

Hi - I'm trying to think of a clever way to write a shell script (trying to stay w/ ksh as that's what I know the best...) that will resolve the following problem: Problem - On a daily basis I have to email folks who are on-call to remind them. I was hoping to script this out so I could have... (9 Replies)
Discussion started by: littlefrog
9 Replies

10. Shell Programming and Scripting

ksh: dbfFILe: parameter not set

Having the following message returned: FIND REDLOG FILES..... ksh: dbfFILe: parameter not set When I attempt to perform the script below....#!/bin/ksh . $HOME/.profile # Initial Script Prerequisites ORACLE_SID=MDirect ; export ORACLE_SID REDOLOGDIR=$ARCLOGDEST ; export REDOLOGDIR... (2 Replies)
Discussion started by: Cameron
2 Replies
Login or Register to Ask a Question