hi actually I have files *.m that contain objective c code like this :
I want to generate a file that constant or whatever name which contain
//No duplication B/C it's variables
and replace this const variables into whatever file contain the match *.m
for example
My problem I have a lot of classes and I should do this work and rather than do it manually it we be coud to create script to do this work
I hope it's clear now
in shell scripting there is extensive usage of
i> regular expression
ii>sed
iii>awk
can anyone tell me the suitable contexts ...i mean which one is suitable for what kind of operation.
like the reg-exp and sed seems to be doing the same job..i.e pattern matching (1 Reply)
$ cat file.txt
asd
<AA>dev
<LL>def
<RR>sha
This works for me:
$ sed -r 's/^ .*<LL>def/\t<LL>my/' file.txt
asd
<AA>dev
<LL>my
<RR>sha
But, this does not work for me:
$ sed -r 's/^\s+<LL>def/\t<LL>my/' file.txt
asd
... (1 Reply)
Hi, I need
to make some extraction . with the following input to get the right output.
input: /etc/exp/home/bin ====> output: exp
and
input: aex1234 ===> output: ex
Thanks for your help, (4 Replies)
Hi,
I am using the following piece of code for extracting some data from in between some tags ...
$text =~ /<TAG1>(.*)<\/TAG1>.*<TAG2>(.*)<\/TAG2>.*<TAG3>(.*)<\/TAG4>.*<TAG5>(.*)<\/TAG5>/;
$tag1=$1;
print "\n$tag1";
But I am getting an error like
Use of uninitialized value in... (1 Reply)
$var1="LEN";
$VAR2="CODLENTT";
now, var2 contains var1(LEN).How do i check this in perl....
whether one string is a part of another..?
if (<logic>)
{
my operation;
}
what'd be the logic.. (4 Replies)
Respected All,
I have a very big xml in that i want to search only below 3 lines.
<target name ="UpgradePrimaryBox" depends ="configureBox1">
<echo> Finished Upgrading Primary Box </echo>
</target>
grep -i "<target.*UpgradePrimaryBox" this gives me the first line.
then i need to match... (7 Replies)
Hi all,
is there anyone good at bash who will help me?
I need to use syntax ${string/pattern/replacement}
The problematic part where I am stuck is:
#!bin/bash
text="A cat is on a mat."
exp="cat"
newexp="SOMECODEcatSOMECODE"
newtext=${${text}/${exp}/${newexp}}
== > ERROR "wrong... (4 Replies)
Hi Unix Gurus,
yesterday I asked a question and got answer, it works fine.
I have one more thing need to help
in the code
awk '{print substr($0,1,3)"xxx"substr($0,7)}' file
If I have 50 charactor's need to be replaced, is there any easy way to use reg exp or I have to input 50 XXXXx......... (12 Replies)
Discussion started by: ken6503
12 Replies
LEARN ABOUT OSX
stringdups
stringdups(1) BSD General Commands Manual stringdups(1)NAME
stringdups -- Identify duplicate strings or other objects in malloc blocks of a target process
SYNOPSIS
stringdups [-minimumCount count] [-stringsOnly] [-nostacks] [-callTrees] [-invertCallTrees] pid | partial-executable-name
DESCRIPTION
stringdups examines the content of malloc blocks in the specified target process. For all blocks which have the same content, it shows a
line with the number of such blocks, their total allocated size (the total size in the malloc heap, not just the specific size of their con-
tent), and the average allocated size.
If the MallocStackLogging environment variable was set when the target process was launched, stringdups also displays stack backtraces or
call trees showing where all the blocks with a particular grouping of content were allocated.
stringdups gathers the content of blocks of various types including:
o C strings (composed of UTF8 characters, null terminated, of any length)
o Pascal strings (composed of UTF8 characters with length byte at start, no longer than 255 characters, not necessarily null terminated)
o NSString of all types (immutable, mutable, UTF8, Unicode). Malloc blocks which are the storage blocks for non-inline or mutable
NSString's are listed separately. The string content is shown for both but the block sizes accurately show what is allocated in the mal-
loc heap for that particular chunk of storage.
o NSDate
o NSNumber
o NSPathStore2 (Cocoa's representation of file paths)
o item counts for collection classes such as NSArray, NSSet, and NSDictionary
OPTIONS -minimumCount count Only print information for object descriptions which appear at least count times in the target process. The default
minimum count is 2. To see all strings in the target process, use 1 or use 'heap <pid> -addresses all'.
-stringsOnly Only print information for objects that have string content such as C or Pascal strings, or NSString.
-nostacks Do not print stack backtraces or call trees even if the target process has the MallocStackLogging environment variable
set.
-callTrees If stack bactraces are available, then by default all the object descriptions for a particular stack backtrace are con-
solidated together. However if this argument is passed then the output is consolidated by each particular string and a
call tree is displayed showing the allocation backtraces of all occurrences of objects with that description. This out-
put can be very lengthy if minimumCount is a low value, because the same call tree may be displayed many times.
-invertCallTrees Same as except that the call trees are printed from hottest to coldest stack frame, so the leaf malloc call appears
first.
SEE ALSO heap(1), leaks(1), malloc_history(1), vmmap(1), DevToolsSecurity(1)BSD July 21, 2011 BSD