• 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: Shell problems
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell problems


  • Subject: Re: Shell problems
  • From: John Delacour <email@hidden>
  • Date: Sun, 8 Sep 2002 21:45:54 +0100

At 9:43 am -1000 8/9/02, Reinhold Penner wrote:

do shell script "if (-e '/path2file1') cp -f '/path2file1' '/path2file2'"

I will get an error < sh: -c: line 1: syntax error near unexpected token `cp' >

What am I doing wrong and is there another, maybe smarter, way to find out if a file exists and if so act upon it?

Don't know shtuff but this will work

do shell script "perl -e '
open F, qq(/users/jd/junk.txt) and q~do all sorts of things~ and
print qq(Bingo!) or die $!'"

I get the same problem as you with the sh thing, no matter what I put after the ")"

This doesn't give an error, but it doesn't copy the file either:

do shell script "if (-e '/users/jd/junk.txt') then cp -f '/users/jd/junk.txt' '/users/jd/junk2.txt';fi;echo done"

JD
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Shell problems
      • From: John Delacour <email@hidden>
References: 
 >Shell problems (From: Reinhold Penner <email@hidden>)

  • Prev by Date: Using Quark Dictionary Words in a List
  • Next by Date: Re: Script Editor problem in 10.2
  • Previous by thread: Shell problems
  • Next by thread: Re: Shell problems
  • Index(es):
    • Date
    • Thread