This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
String parsing in stap script
- From: Mike Mason <mmlnx at us dot ibm dot com>
- To: systemtap at sources dot redhat dot com
- Date: Thu, 09 Nov 2006 11:25:50 -0800
- Subject: String parsing in stap script
I'm trying to figure out how to parse a string in a stap script. Ideally, I'd like a function like strsep() where I pass in a string and delimiter and get back a token and a pointer to the string past the token. Given that a stap function can only pass back one value, I don't see how to accomplish this. Any suggestions or is this just not possible?
BTW, my initial reason for wanting this is to pass an array from a shell script to a stap script. I figure I can just pass it as one long delimited string, then parse it on the stap side to get it back in array form.
- Mike