Hi,
I'm new to ksh - unix platform. I'm writing a small script which will search my current directory and will search for file names which it takes input from the users.
Here is the code I'm having.
1 #!/bin/ksh
2 echo "enter a file name to be searched in the current dir : "
3 read filename
4
5 file="find . -name "$filename""
6 exec $file
The Problem is when I put a valid file name which is present in my dir, it shows the path name, which is correct. But when I put an invalid path name it shows no messages. Since, I'm using an exec command it shows the output directly to the console. How can I trap the output from the exec command so that I can add custome messages.
Please help.