Find question
am 21.10.2007 14:38:29 von apogeusistemas
Hi:
Why this script show me all files in my directory, and not only
$file ?
if [ $# -eq 0 ]
then
echo " Please type file name: \c"
read file
if [ -z $file ]
then
exit 0
fi
fi
for arq in `find . `pwd` -name $file`
do
ls -alF $file
done
Thank you
Re: Find question
am 21.10.2007 14:49:12 von Stephane CHAZELAS
2007-10-21, 12:38(-00), apogeusistemas@gmail.com:
[...]
> for arq in `find . `pwd` -name $file`
That's the same as
for arq in find $(find . )pwd$( -name $file)
If you want to nest command substitution using backticks, you
need to escape the inner ones.
> do
> ls -alF $file
> done
[...]
Try instead
find . "$PWD" -name "$file" -exec ls -alFd {} +
Or if you have a very old system and the above doesn't work:
find . "`pwd`" -name "$file" -exec ls -alFd {} \;
--
Stéphane
Re: Find question
am 21.10.2007 16:53:36 von apogeusistemas
On 21 out, 10:49, Stephane CHAZELAS wrote:
> 2007-10-21, 12:38(-00), apogeusiste...@gmail.com:
> [...]
>
> > for arq in `find . `pwd` -name $file`
>
> That's the same as
>
> for arq in find $(find . )pwd$( -name $file)
>
> If you want to nest command substitution using backticks, you
> need to escape the inner ones.
>
> > do
> > ls -alF $file
> > done
>
> [...]
>
> Try instead
>
> find . "$PWD" -name "$file" -exec ls -alFd {} +
>
> Or if you have a very old system and the above doesn't work:
>
> find . "`pwd`" -name "$file" -exec ls -alFd {} \;
>
> --
> St=E9phane
I made this changes without success...
Re: Find question
am 21.10.2007 17:20:23 von huge
On 2007-10-21, apogeusistemas@gmail.com wrote:
> Hi:
> Why this script show me all files in my directory, and not only
> $file ?
>
> if [ $# -eq 0 ]
> then
> echo " Please type file name: \c"
> read file
> if [ -z $file ]
> then
> exit 0
> fi
> fi
> for arq in `find . `pwd` -name $file`
Your find command is wrong.
--
"Be thankful that you have a life, and forsake your vain
and presumptuous desire for a second one."
[email me at huge {at} huge (dot) org uk]
Re: Find question
am 21.10.2007 17:34:26 von apogeusistemas
On 21 out, 12:53, apogeusiste...@gmail.com wrote:
> On 21 out, 10:49, Stephane CHAZELAS wrote:
>
>
>
>
>
> > 2007-10-21, 12:38(-00), apogeusiste...@gmail.com:
> > [...]
>
> > > for arq in `find . `pwd` -name $file`
>
> > That's the same as
>
> > for arq in find $(find . )pwd$( -name $file)
>
> > If you want to nest command substitution using backticks, you
> > need to escape the inner ones.
>
> > > do
> > > ls -alF $file
> > > done
>
> > [...]
>
> > Try instead
>
> > find . "$PWD" -name "$file" -exec ls -alFd {} +
>
> > Or if you have a very old system and the above doesn't work:
>
> > find . "`pwd`" -name "$file" -exec ls -alFd {} \;
>
> > --
> > St=E9phane
>
> I made this changes without success...- Ocultar texto entre aspas -
>
> - Mostrar texto entre aspas -
Please dischart - My mistake...
Thanks...