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



On Monday, March 29, 2004, at 09:01 am, Adrian Bool wrote:


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

hiyer Adrian,

yes thanks for that. i thought of doing some swapping jiggery like you've done to get it done but didn't try it as i thought i was missing a direct, easier way.

there aren't many references to tops on the internet that i can find. here's one though <http://groups.google.com/groups?q=isOneOf+tops&hl=en&lr=&ie=UTF- 8&oe=UTF- 8&selm=y0m76.115000%email@hidden&rnum=1> could be helpful. in any case, i'll keep messing with it.

thanks, ben.
_______________________________________________
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: Adrian Bool <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.