Re: shell scripts issue
Date: Fri, 27 Nov 2009 11:07:18 +0100
On 27/11/2009 10.51, Radoulov, Dimitre wrote:
> 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 `
> [...] ^^^^^^
Just noticed you're using a GNU system, so with bash/GNU find you can use the following syntax:
read -p'enter filename: '
find "$_path" -type f -name "$REPLY" -printf 'found: %p\n' )"
[[ $_found ]] &&
printf '%s\n' "$_found" ||
printf 'cannot find %s under %s\n' "$REPLY" "$_path"
> Try changing the script like this:
Dimitre Received on Fri Nov 27 2009 - 04:07:18 CST