[Ilugc] strtok

  • From: vivek@xxxxxxxxxxxx (Viveka Nathan K)
  • Date: Tue Jul 20 12:13:39 2004

Hi..

    By using strtok(), if I read the /etc/passwd file with delimiter 
":",
    I am not getting expected result.  For example, if a line contains

    rpm:x:37:37::/var/lib/rpm:/bin/bash

    the '::' is read at once instead of twice.
    Is there any other way to read data with delimiter ?

Thanks,
-- 
Viveka Nathan K
IndoFuji Information Technologies Pvt Ltd., Bangalore 560 076.
www.indofuji.com   Ph: 080-26784122/33/55 (ext) 46

Other related posts: