A
alij
Hi,
I have a string (pointed by variable sourceStr) in the following
possible formats:
? ls : ps
? ls -a : touch nfile
I used sscanf(sourceStr, "? %s : %s", cmd1, cmd2) to extract the
values, but the problem I'm getting is, it works fine for the first
example, but not the second example.
Any Idea if its possible to do this using sscanf function, or on what
I'm doing wrong? I'll appreciate any pointers.
Thanks!!
Alij
I have a string (pointed by variable sourceStr) in the following
possible formats:
? ls : ps
? ls -a : touch nfile
and ls -a, touch nfile.From the lines above, I want to extract the commands, which are ls, ps
I used sscanf(sourceStr, "? %s : %s", cmd1, cmd2) to extract the
values, but the problem I'm getting is, it works fine for the first
example, but not the second example.
Any Idea if its possible to do this using sscanf function, or on what
I'm doing wrong? I'll appreciate any pointers.
Thanks!!
Alij