• 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 script build phases
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Shell script build phases


  • Subject: Re: Shell script build phases
  • From: April Gendill <email@hidden>
  • Date: Sat, 20 Dec 2003 14:53:55 -0700

On Dec 20, 2003, at 11:16 AM, Eugene Lee wrote:

On Sat, Dec 20, 2003 at 09:43:19AM -0700, April Gendill wrote:
:
: I need to write a shell script that tests for the existence of a file
: and then performs a function if the file is there.
:
: I have spent hours in the man pages and online and have found that I
: cannot read english because even when I follow the examples I cannot
: make the script work...
:
: here is the script I'm using:
:
: if (filetest -e "/Path to/A file") then
: rm "/Path to/A file"
: fi

This solution works for any sane Bourne shell:

#!/bin/sh
fname='/Path to/A file'
if [ -e "${fname}" ]; then
rm "${fname}"
fi


Thanks :)


--
Eugene Lee
eugene at anime dot net
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >Shell script build phases (From: April Gendill <email@hidden>)
 >Re: Shell script build phases (From: Eugene Lee <email@hidden>)

  • Prev by Date: Splash screens
  • Next by Date: Re: Parsing XML and DTD's (XML Newbie)
  • Previous by thread: Re: Shell script build phases
  • Next by thread: programmatically modifying NSPopUpButton's NSMenu
  • Index(es):
    • Date
    • Thread