Problem for novice


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Problem for novice
# 8  
Old 06-30-2005
Yes my shell is KSH.
# 9  
Old 07-01-2005
Did any one know why I am getting this error. my cnt is 0 and maxcnt is 10.
Do help me out.
# 10  
Old 07-01-2005
Please don't bump up your post. It's a violation of the rules.

Run your script as such:

ksh -x scriptname

And then post the results back.
# 11  
Old 07-01-2005
Sorry for Bumping the post

My script is as follows
MYDIR=$1
cd $MYDIR

echo $MYDIR
for file in `ls *.txt`
do
echo $file

while (true)
echo 111
do
echo 222
pscnt=`ps -ef|grep "invokeScript.ksh"|grep -v "grep"|wc -l`
if ( pscnt < MAXCNT )
then
echo 333
invokeScript.ksh $USERID $PASSWD $InstanceId $file &
fi
break
done

done

And response after I used ksh-x is as follows



+ MYDIR=/home/cmn/src/spt/qry
+ cd /home/cmn/src/spt/qry
+ echo /home/cmn/src/spt/qry
/home/cmn/src/spt/qry
+ ls q1.txt q10.txt q100.txt q11.txt q12.txt q13.txt q14.txt q15.txt q16.txt q17.txt q18.txt q19.txt
+ echo q1.txt
q1.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q10.txt
q10.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q100.txt
q100.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q11.txt
q11.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q12.txt
q12.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q13.txt
q13.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q14.txt
q14.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q15.txt
q15.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q16.txt
q16.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q17.txt
q17.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q18.txt
q18.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
+ echo q19.txt
q19.txt
+ true
+ echo 111
111
+ echo 222
222
+ + ps -ef
+ grep invokeScript.ksh
+ wc -l
+ grep -v grep
pscnt= 0
+ pscnt
+ A file or directory in the path name does not exist.
run10.ksh[29]: MAXCNT: 0403-016 Cannot find or open the file.
+ break
# 12  
Old 07-01-2005
  1. where do you define that your script is ksh?
  2. where do you set MAXCNT?
  3. UUOL - for file in *.txt
# 13  
Old 07-01-2005
In original script I had declared MAXCNT
and I didn't get the third point
# 14  
Old 07-01-2005
Quote:
Originally Posted by deepaksamuel
In original script I had declared MAXCNT
ok. Did you define your script as a /bin/ksh script?

Quote:
Originally Posted by deepaksamuel
and I didn't get the third point
UUOL - Useless Use Of Ls, e.g.:
Code:
 for file in `ls *.txt`

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

SED problem - Novice question

Hi, Need some help with a sed command I have butchered together (with help from this forum): I have a script that has the following output (a small example of the full file): example.txt 092F 1639163_Cluster01_Prod 0522 1639163_Cluster02_Prod 08C2 1639163_Cluster07_Prod 0957... (2 Replies)
Discussion started by: colinwilson1303
2 Replies

2. Programming

Novice in C needs help

Guys can you help me ? I'm novice in C but I have a lot of will to master C. Each gurney starts with first step O.K. My problem is to compare two integers entered by user I know how to set up conditions and problem is how to print correct value (grater number) // This program... (5 Replies)
Discussion started by: solaris_user
5 Replies

3. Shell Programming and Scripting

sed question from novice

My pipe delimited file is coming over with spurious “\” characters inserted into some alpha fields, which is causing the records to be split into 2. Eg Abc|def|10/11\ AAAA|xyz Lmn|opq|10/11BBBB|xyz etc etc I am having to go into vi, then enter / \ to... (5 Replies)
Discussion started by: malts18
5 Replies

4. Shell Programming and Scripting

Need help with a little script - novice

I am just learning unix and need some help. I am trying to display all of the files I have modified within the last 24 hours and sort them from the most recently modified. I can't figure it out.. I've been using a lot of ls and find commands. Here are some things I've tried: find . -mtime -1 |... (4 Replies)
Discussion started by: mredwin3
4 Replies

5. UNIX for Dummies Questions & Answers

NEW to Unix (novice)

Heya all Im just reading up on the solaris o/s and unix and i just have the following qustions 1) is the solaris o/s the same as Unix if not how are they different - i.e. are they different operating systems? 2) Can the Unix be loaded from CD without affectin windows o/s just like linux... (2 Replies)
Discussion started by: new214
2 Replies

6. Solaris

New to solaris (novice)

Heya all Im just reading up on the solaris o/s and have a few questions regarding it: 1) is the solaris of free to use/download? if yes where? 2) Can the solaris o/s be loaded from CD without affectin windows o/s just like linux can? 3) what are the hardware requirements for using... (2 Replies)
Discussion started by: new214
2 Replies

7. Shell Programming and Scripting

Unix scripting-Need help-NOVICE -PLEASE HELP

I really want to get into unix scripting,work with RS6000 -AIX. How do i get started,what books are good for beginners,i am very desperate I have no programming background but ready to scrafice all my time in learning .please help. PLEASE,PLEASE PLEASE ,HELP.... Any advice will realy... (2 Replies)
Discussion started by: Ghanaman
2 Replies

8. Linux

Hi I M Novice User

hi everyone i m a novice user . just want to know how to use this website and also learn unix from the basics. can any one help me please.... (2 Replies)
Discussion started by: MSK
2 Replies

9. Programming

novice student needs help

Help! I am very stuck!!! I have to produce a practical implementation of ONC RPC for an assignment and I do not know where to start. I hve done much searching on sun's site but everything is too complicated for someone with my limited knowledge. I only know the very basic unix commands and have... (1 Reply)
Discussion started by: karen79
1 Replies

10. Linux

Question From a Novice

HELLO GUYS, How u all guys doing?Recently I brought a system and installed Red Hat Linux in it. I have also got a network card. My question is can i connect NIC to my system and use it as a client? I really don't want to buy another system. I want to use this computer/system both as server and... (0 Replies)
Discussion started by: cyno
0 Replies
Login or Register to Ask a Question