[BACK]Return to repl.c CVS log [TXT][DIR] Up to [local] / OpenXM / rc

File: [local] / OpenXM / rc / repl.c (download)

Revision 1.1, Tue Jan 18 09:38:58 2000 UTC (24 years, 3 months ago) by takayama
Branch: MAIN

Automatically generate dot.cshrc and dot.bashrc.
You can put OpenXM at any place.

/* $OpenXM: OpenXM/rc/repl.c,v 1.1 2000/01/18 09:38:58 takayama Exp $ */
#include <stdio.h>
#include <unistd.h>

#define BUFSIZE 10000
main() {
  char s[BUFSIZE];
  char cwd[BUFSIZE];
  getcwd(cwd,BUFSIZE);
  while (fgets(s,BUFSIZE,stdin) != NULL) {
	if (strcmp(s,"OpenXM_HOME=$HOME/OpenXM\n") == 0) {
	  printf("OpenXM_HOME=%s/../../OpenXM\n",cwd);
	}else if (strcmp(s,"setenv OpenXM_HOME $HOME/OpenXM\n") == 0) {
	  printf("setenv OpenXM_HOME %s/../../OpenXM\n",cwd);
	}else{
	  printf("%s",s);
	}
  }
}