Please help problem in KSH

Hi All,

I have got a problem. I have written a Shell script which cuts some information from the file a and puts it in file b. But i get this error when i execute the shell script.
This is what i have written in the script.

#! /usr/bin
cd /test
ls $2 > a
cut -f 1 -d '.' a > b

When i try to execute this script with this command-->
./test.sh 100 Eagle.txt
i get this error -> cut: 0653-132 Cannot open a.

:frowning: i know its a dumb doubt.Please help

You are doing a cd to /test . I think you do not have Eagle.txt in /test and is causing the problem. You need to copy Eagle.txt to /test and then run the script

That first line can't be right. Try:
#! /usr/bin/ksh