Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: tops command line help please



Hi Ben

On 29 Mar 2004, at 02:22, Ben Dougall wrote:

it hasn't made any distinction between variable names and method names. i can't see which option, if any, specifies only change variables. args seemed to be the most likely but doesn't look like it.

how do you specify only variables?

Intresting problem that! I too had a good read of the man page and a play after that but could not do what you want directly. However, you can change functions cleanly with tops, so if you do it in three stages by shifting functions that correspond to your search to an unused value, do a generic replace and then restore the generic value you get the effect you want. Try this,

change_var.sh:

#!/bin/sh
#
echo "changing variables $1 to $2 in file $3"

tops replacemethod "$1" with "CHANGE_VAR_TEMPORARY" $3
tops replace "$1" with "$2" $3
tops replacemethod "CHANGE_VAR_TEMPORARY" with "$1" $3

Then,

chmod a+x change_var.sh
./change_var.sh test anotherName Test.m

If anyone can do it in one tops call would be nice to know how!

Cheers,

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


References: 
 >Re: tops command line help please (From: Ben Dougall <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.