LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris, OpenSolaris, OpenIndiana, and illumos.
General Sun, SunOS and Sparc related questions also go here. Any Solaris fork or distribution is welcome.

Notices


Reply
  Search this Thread
Old 03-28-2006, 05:40 PM   #1
hpinto
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Rep: Reputation: 0
Problems to execute the FIND command


Hi All,

I'm trying to create a file with the path and names of all CPP files that I have. For that I'm using the following simple command:
Quote:
find . -name *.cpp
But I'm getting the following message:
Quote:
find: bad option exabrt.cpp
find: path-list predicate-list
Where exabrt.cpp is one of the files that I have.

It's important to day that the same command works perfectly wit many other extensions (*.h or *.for or *.c). I'm running this command under Solaris.

Does anyone have any ideas what is going on?

Thanks in advance,
Herminio
 
Old 03-28-2006, 05:58 PM   #2
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
Have you tried it with the name argument wrapped in quotes:
Code:
find . -name '*.cpp'
I think the shell is expanding your *.cpp to the list of names of the cpp files in your current directory and handing that list to find. Wrapping it in quotes prevents that.
 
Old 03-28-2006, 06:56 PM   #3
hpinto
LQ Newbie
 
Registered: Mar 2006
Posts: 2

Original Poster
Rep: Reputation: 0
It works

It works!

Thanks a lot.

Herminio
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
how can I execute two commands on exec of a find? eantoranz Programming 3 08-03-2010 04:51 PM
cannot execute the find command as expected ? kushalkoolwal Programming 5 01-25-2006 10:33 PM
remote command execute telnet with 1 command MPowers Linux - Networking 2 06-30-2005 06:31 AM
command execute without ./ kaon Slackware 11 09-15-2004 05:14 PM
Execute Command lawrencegoodman Linux - Newbie 2 10-23-2003 08:36 AM

LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration