• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What have I done? / do shell script mystery
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What have I done? / do shell script mystery


  • Subject: Re: What have I done? / do shell script mystery
  • From: "Mark J. Reed" <email@hidden>
  • Date: Sat, 22 Oct 2005 08:54:24 -0400

What happened is that you have a file named something.txt in whatever your current working directory is when you run the do shell script.  The shell expands wildcards before the command line gets run, so by the time find starts up and looks at its argument list, it sees "something.txt" instead of "*.txt", and it only finds one file with that specific name.

It works in Terminal because your current directory is not the same and does not contain any .txt files; if there is no file matching a wildcard, the shell leaves it alone.

The quotation marks prevent the shell from expanding the wildcard; instead it passes it on verbatim to find, and it's up to find to interpret it.


On 10/22/05, Richard Rönnbäck <email@hidden> wrote:
It works! :-)

Thanks Shane!

I'll by you a very large beer shortly :-)




> From: Shane Stanley <email@hidden>

> What happens if you put quotes around *.txt:


_______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden

This email sent to
email@hidden



--
Mark J. Reed <email@hidden>
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Applescript-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: What have I done? / do shell script mystery
      • From: Richard Rönnbäck <email@hidden>
References: 
 >Re: What have I done? / do shell script mystery (From: Shane Stanley <email@hidden>)
 >Re: What have I done? / do shell script mystery (From: Richard Rönnbäck <email@hidden>)

  • Prev by Date: Re: Days and hours
  • Next by Date: Re: Days and hours
  • Previous by thread: Re: What have I done? / do shell script mystery
  • Next by thread: Re: What have I done? / do shell script mystery
  • Index(es):
    • Date
    • Thread