Reputation: 7135
I have to extract the first parameter of the following function calls using sed.
strlcpy(p->name,getInfo(NULL,&account));
strlcpy(p->balance,getInfo(NULL,&account));
strlcpy(p->number,getInfo(NULL,&account));
strlcpy(p->address,getInfo(NULL,&account));
Expecting the result of string as below.
p->name
p->balance
p->number
p->address
The following command prints the additional details, I am expecting only the first parameters.
sed -n 's/strlcpy(\(.*\),/\1/p' kk.txt
p->name,getInfo(NULL&account));
p->balance,getInfo(NULL&account));
p->number,getInfo(NULL&account));
p->address,getInfo(NULL&account));
Upvotes: 0
Views: 59