The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



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

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
quoting in conditional statement 3Gmobile Shell Programming and Scripting 2 08-14-2006 03:14 AM
M4 quoting drives me crazy hindman Shell Programming and Scripting 0 05-26-2006 10:30 AM
Quoting of special characters vibhor_agarwali UNIX for Dummies Questions & Answers 1 01-30-2005 04:58 AM
quoting echo 'it's friday' yls177 UNIX for Dummies Questions & Answers 3 09-19-2002 11:09 PM
Wildcards and quoting Bab00shka UNIX for Dummies Questions & Answers 2 09-16-2002 10:16 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-02-2006
tphyahoo tphyahoo is offline
Registered User
  
 

Join Date: Apr 2006
Posts: 24
*.pm globs without quoting, *.pl doesn't.

Can someone explain the following? I can use find on *.pm without quotes, but find on *.pl makes on error, I need quotes for the second version. What's up with that?

Code:
$find -name *.pm
./tieProxyStatus/Status.pm
$find -name *.pl
find: paths must precede expression
Usage: find [-H] [-L] [-P] [path...] [expression]
$find -name '*.pl'
./persistence/dbm/persistenceFileRead.pl
  #2 (permalink)  
Old 06-02-2006
vgersh99's Avatar
vgersh99 vgersh99 is online now Forum Staff  
Moderator
  
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 5,119
'cause you do NOT have any .pm files in your current directory, but you DO have .pl file(s).

Without the quoting shell will expand the wildcards PRIOR invoking any command/find.
  #3 (permalink)  
Old 06-02-2006
cbkihong cbkihong is offline Forum Advisor  
Advisor
  
 

Join Date: Sep 2002
Location: Hong Kong, China
Posts: 1,624
Do you have any .pl files in the current directory? If so, the shell will expand '*.pl' into a list of files thus breaking the expectation of find. It may just happen that you don't have any files matching '*.pm' in your current directory so '*.pm' is passed verbatim to find. That's the expected behaviour.
Closed Thread

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 12:57 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0