• 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: problem with shell script Build Phase
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problem with shell script Build Phase


  • Subject: Re: problem with shell script Build Phase
  • From: Jeremy Dronfield <email@hidden>
  • Date: Fri, 10 Mar 2006 11:08:40 +0000

On 10 Mar 2006, at 8:11 am, Steve Checkoway wrote:


On Mar 9, 2006, at 3:56 PM, Joseph Kelly wrote:
Put the script variables in quotes, and you'll get much better results. I've gotten into the habit of putting everything even numeric constants in quotes (/bin/sh, forgiveness in advance):

			cp "$THINGIE" "$PARENT_DIR"
			if [ "$?" -ne "0" ]; then
				echo "Error: thingie failed to copy (err=$?)"
				exit $?
			fi

If you want to compare strings, use !=, if you want to compare numbers use -ne. In this case, you should probably use [ $? -ne 0 ]. If you really want to use strings, use [ "$?" != "0" ].


- Steve

Good tips. Thanks.

- Jeremy
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >problem with shell script Build Phase (From: Tommy Nordgren <email@hidden>)
 >Re: problem with shell script Build Phase (From: Jeremy Dronfield <email@hidden>)
 >Re: problem with shell script Build Phase (From: Joseph Kelly <email@hidden>)
 >Re: problem with shell script Build Phase (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: Link against a ".la" file
  • Next by Date: Static linking issue
  • Previous by thread: Re: problem with shell script Build Phase
  • Next by thread: Link problem : undefined symbol
  • Index(es):
    • Date
    • Thread