Sunsolaris shell script runs only as super user

Hi Friends,
I am new to Sun solaris unix.I am facing problem while runing my kornshell script just as an ordinary user.The script works fine while i am working as a super user.the script just uses awk to check the first charcter of a file and then copies the file to another folder. Do i need to change any enviornment variable. Please help

Jithin.G

What error messages do you get?
Post your script.
Are you sure you (as normal user) have the rights to read this file ans write to the other folder? What do "ls -l your_file" and "ls -ld your_folder" say?

my script is

line=$(awk '{if(substr($0,1,1)!="#" &&
substr($0,1,1)!=";" &&
substr($0,1,1)!=" " &&
substr($0,1,1)!="/" &&
substr($0,1,1)!="*" &&
substr($0,1,1)!="\\" &&
length($0)!=0)
{print $0}
}' filename

This works fine when i login as super user but it does not work with other user and show error.

I am still geting the error

....ksh[line]: awk: not found

ls -l file name gives
-rwxrwxrwx 1 jithin other 38388 date filename

ls -ld folder gives
drwxrwxrwx 2 jithin other 512 date foldername

pretty obvious:

ksh[line]: awk: not found

Your $PATH environment variable as normal user does not consist of the directory where your awk resides. What give "which awk" and "echo $PATH" as superuser? What gives "echo $PATH" as normal user? Add the missing dir to normal user's $PATH.

$PATH in super user has another component /usr/sbin
But which awk in both super user and user gives /usr/bin
I tried to change $PATH in *.profile file of user .it changes in file . But then again i checked the echo $PATH it shows the same earlier result.