Bash Scripting Help Needed
James McDonald
james
Thu Oct 21 09:29:33 PDT 2004
>> find Admin/ -regex .*vbs$ -print0 -exec cp \{\} /home/jamesm/tmp/ \;
>
> This is a fine example of a find command.
>
> I believe you ran into a limitation of xargs. It can only handle a command
> followed by initial arguments because xargs just appends the input from
> (in
> this case) find to the command specified. Does that make sense?
I'm always relieved to find out it's the command that doesn't have the
feature I want and not my myopia at what I call 'man page blindness'.
I have just today had a situation where I was looking for a... please don't
hate me a Windows Small Business Server 2003 Product Key on the server and
my workstation at work and my two computers at home. Trying to find a
XXXXX-XXXXX-XXXXX-XXXXX-XXXXX format string was difficult until grep and
cygwin came to the rescue. grep spat out every instance of text files that I
had the string I was looking for....
grep -r -E '\w{5}\-\w{5}\-\w{5}\-\w{5}\-\w{5}\b' /cygdrive/c/admin/INSTALL/
/cygdrive/c/admin/INSTALL/I386/UNATTEND.TXT:
ProductID=K9MMC-6636M-YFKBK-T8MT
H-XXXXX
So I must say that the GNU tools that come with Linux have really helped....
More information about the Linux-users
mailing list