cancel
Showing results for 
Search instead for 
Did you mean: 

Ksh parameter not set error

SOLVED
Go to solution
Anand_30
Regular Advisor

Ksh parameter not set error

I am trying to extract some file in the following format.

month date time file

I am using the following command:

ls -l|grep file|print{$6,$7,$8,"/t"$9}

But I am getting the following error:
ksh:parameter not set

Can anyone please tell me how to get rid of this problem.

Thanks,
-Anand




7 REPLIES
Steven E. Protter
Exalted Contributor

Re: Ksh parameter not set error

Post the script.

It looks like you don't have the shell defined properly.


#!/usr/bin/ksh


For example.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Mark Grant
Honored Contributor
Solution

Re: Ksh parameter not set error

I think it thinks "print" is parameter.

Try

ls -l | grep file | awk '{ print $6,$7,$8,"\t",$9 }'

Never preceed any demonstration with anything more predictive than "watch this"
Jean-Luc Oudart
Honored Contributor

Re: Ksh parameter not set error

try
ls -l|grep file|awk '{printf("%s %s %s\t%s\n",$6,$7,$8,$9);}'

I suppose "file" has different value depending on your query

Rgds,
Jean-Luc
fiat lux
Anand_30
Regular Advisor

Re: Ksh parameter not set error

Thanks

Both the commands worked fine.

-Anand.
setubabu s
Occasional Visitor

Re: Ksh parameter not set error

HI Anand,

use the awk command.

ls -l |grep file |awk '{print $6,$7}'
Johnson Punniyalingam
Honored Contributor

Re: Ksh parameter not set error

Hi setubabu s,

is there any point in reply to thread which opend 7 year older ...:(

Sep 30, 2003 12:59:41 GMT N/A: Question Author
Problems are common to all, but attitude makes the difference
Horia Chirculescu
Honored Contributor

Re: Ksh parameter not set error

>is there any point in reply to thread which opend 7 year older

Maybe there is a time loop out there...

See Stargate SG1/Atlantis episodes. (http://stargate.mgm.com/)

Horia.
Best regards from Romania,
Horia.