Hi,

I have an example program from one book, it looks like this:

Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char *argv[]){
      char *args, *s1, *s2;
      char buffer[128];
      int i;

      args = argv[1];
      s1 = "/bin/sh";
      s2 = "/bin/ps";

      if(argc > 1) {
         for ( i = 0; i <= 128; i++)
            buffer[i] = args[i];
      }
      system(s2);
      return 0;
}
My question is: how to make that program to get the value for system() not from s2 but s1?

Any ideas?