Re: shell scripts issue

From: Radoulov, Dimitre <cichomitiko_at_gmail.com>
Date: Fri, 27 Nov 2009 10:51:07 +0100
Message-ID: <heo7ej$afa$1_at_news.eternal-september.org>



On 27/11/2009 6.51, Ram wrote:
> Hi all,
>
> My scripts looks like this .. when i execute this script its says file
> does not exist even though file is present physically and if the file
> does not present in the file system then the output is null.
>
> I am wrong somewhere .. ??
>
>
> echo " enter file "
> read name
> for i in `find /apps12i -type f -name $name -printf %f `
[...]

Try changing the script like this:

_path="/apps12i"

printf 'enter filename: '

read

_found="$(

   find "$_path" -type f -name "$REPLY" -exec printf 'found: %s\n' {} \; )"

[ "$_found" ] &&

   printf '%s\n' "$_found" ||

      printf 'cannot find %s under %s\n' "$REPLY" "$_path"

Regards
Dimitre Received on Fri Nov 27 2009 - 03:51:07 CST

Original text of this message