find: No match due to find command being argument | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

find: No match due to find command being argument

Shell Programming and Scripting


Tags
find, find no match, no match

Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 08-03-2009
mst3k4l mst3k4l is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 10 September 2009, 3:00 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
find: No match due to find command being argument

I am using csh and getting the error "find: No match." but I cannot figure out why. What I am trying to do is set the find command to a variable and then execute the variable as a command. I ran it through a debugger and it looks like $FIND is getting set but the find command can not actually be found. Here is what the debugger produced:
Quote:
set LIST = find orion/ic -path *arg*
find: No match.
The actual code states:

Code:
set LIST = "find orion/ic -path *arg*"
${LIST} -name "*.ic"

However, the code does work when *arg* is not included in the definition of $LIST. *arg* does need to be in quotes though.

Code:
set LIST = "find orion/ic -path"
${LIST} "*arg*" -name "*.ic"

As a result, I tried to put quotes around *arg* when it was part of $LIST, but I received the same "No match" error.
Quote:
set LIST = find orion/ic -path "*arg*"
find: No match.
This code is being added to an already existing script, so csh MUST be used.
Sponsored Links
    #2  
Old 08-07-2009
Scott's Avatar
Scott Scott is offline Forum Staff  
Administrator
 
Join Date: Jun 2009
Last Activity: 13 December 2014, 6:28 PM EST
Location: Zürich
Posts: 8,489
Thanks: 333
Thanked 1,050 Times in 916 Posts
Hi.

I do believe, after looking at this that I am a confirmed C-Shell disliker (previously I was just an unconfirmed C-Shell disliker!).

But perhaps you can incorporate a little bit of normality in you csh script:


Code:
#!/bin/csh
set LIST="find orion/ic -path *arg*"
ksh << !
$LIST
!
 
 
Output:
orion/ic/blah/11111argZZZ
orion/ic/blah/123argXYZ

Using only csh, I get this:


Code:
#!/bin/csh
set LIST="find orion/ic -path *arg*"
#ksh << !
$LIST
#!
/root/tmp2 # ./Test
find: No match.

Sponsored Links
    #3  
Old 08-10-2009
mst3k4l mst3k4l is offline
Registered User
 
Join Date: Aug 2009
Last Activity: 10 September 2009, 3:00 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
I do not like csh either, but the script I was modifing was already written in the language. Good idea about about putting ksh in there, and I might do that next time. What I ended up doing was just writing the command to a tmp file and then running the tmp file. Not the most elegant solution, but it got the job done.
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to find first match and last match in a file praving5 Shell Programming and Scripting 3 04-01-2009 08:33 AM
how to find a file named vijay in a directory using find command amirthraj_12 UNIX for Dummies Questions & Answers 6 10-25-2008 01:37 PM
How to find the last argument in a argument line? nehagupta2008 UNIX for Dummies Questions & Answers 4 06-20-2008 12:05 PM
Little bit weired : Find files in UNIX w/o using find or where command jatin.jain Shell Programming and Scripting 10 09-19-2007 07:47 AM
command find returned bash: /usr/bin/find: Argument list too long yacsil Shell Programming and Scripting 1 12-15-2003 06:38 PM



All times are GMT -4. The time now is 07:13 PM.