Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by KungFooMaster

  1. KungFooMaster

    newbie help

    int partof(const char *s1, const char *s2) { return strstr(s1, s2) != NULL; }
  2. KungFooMaster

    logically invoking blocks of code

    Shell programming is linear. Just place one block after the other and include a test to see if they each completed successfully: # Block 1 # If failed, bail # Block 2 # If failed, bail # Block 3 Whether you're using a huge loop or a single command is irrelevant.
  3. KungFooMaster

    seeing the directory you are in without having to type pwd

    I'm not terribly familiar with ksh, but you should be able to find the equivalent commands for my csh custom prompt. I have this in my .cshrc file: alias setprompt 'set prompt="\cwd: ${cwd}\% "' alias cd 'chdir \!* && setprompt' The prompt it gives me is cwd: /home/user % with the...
  4. KungFooMaster

    General purpose string substitute function anyone?

    This may not work any different, but it'll probably be more efficient and certainly easier to follow IMHO. #include <stdlib.h> #include <string.h> char *s(const char *str, const char *replace, const char *with) { char *rp; char *pos; size_t bufsiz; if ((pos = strstr(str, replace))...

Part and Inventory Search

Back
Top